> ## Documentation Index
> Fetch the complete documentation index at: https://docs.useshipd.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Release records

> Record release plans, evidence, and the action history for manual and authorized rollouts.

## Overview

A release record keeps a project's release plan, progress, and supporting evidence in one environment. Manual actions record operator declarations. When configured and explicitly authorized, the controller can publish scoped flag changes and record their results.

> [!NOTE]
>
> Signal-driven progressive rollouts require the `code-release-control` feature flag and a configured Sentry connection.

## Separate intent from observation

Release state tracks progress. A manual lifecycle transition records the operator's declaration. When the controller runs an authorized release, it records each flag publication and its read-back result in the action history. Use that history together with deployment and flag state to verify what customers are seeing.

The progress response explicitly reports deployment observation as `unknown` and flag, approval, and exposure observations as `not_checked`. Check the deployment system, [flag environment states](https://docs.useshipd.com/reference/mcp.md), and [approval status](https://docs.useshipd.com/reference/approvals.md) separately. Attach the results as evidence, clearly distinguishing reported claims from verified observations.

## Plan a release

```ts theme={null}
// Release plan input, shared by the API and MCP.
type ReleasePlan = {
  title: string;
  flagIds: string[]; // existing flags in this project; at most 50, no duplicates
  pullRequest: string | null; // HTTPS URL without credentials
  commitSha: string | null; // full 40-character hexadecimal SHA
  deploymentRef: string | null; // external reference, not an execution request
  audiences: string[];
  stages: {
    id: string; // unique within the plan
    name: string;
    audience: string;
    successCriteria: string[];
    healthPolicy?: ReleaseHealthPolicy; // see assessHealth
  }[];
  successCriteria: string[];
};
```

Include at least one audience, stage, and success criterion. Stage IDs are stable identifiers, not flag targeting rules. A plan can describe an audience without creating or changing it. You can revise the plan only in `preparation` or `awaiting_deployment`; it is frozen from `ready` onward.

## State transitions

| Current state | Allowed next states |
| - | - |
| `preparation` | `awaiting_deployment` |
| `awaiting_deployment` | `preparation`, `ready` |
| `ready` | `rolling_out`, `paused`, `rolled_back` |
| `rolling_out` | `paused`, `rolled_back`, `complete` |
| `paused` | `rolling_out`, `rolled_back` |
| `rolled_back` | None |
| `complete` | None |

Every manual transition requires a note. Moving to `ready` requires a PR URL, commit SHA, and deployment reference. Complete stages in plan order while `rolling_out`. All stages must be recorded complete before moving to `complete`. Terminal records still accept evidence. Use the controller commands for pauses and resumes while an authorization is active.

## Authentication and retries

All routes use `POST /api/v1/rpc/release/…` with the usual control-plane authentication. Reads require flag-read access. Manual ledger writes require flag-update access. Controller commands require flag state write access. Access is scoped to the release's project and environment. MCP also enforces the connection's organization, project restrictions, write access, and current user permissions. [Control-plane authentication](https://docs.useshipd.com/reference/control-plane-api.md#authentication-and-route-restrictions)

Every manual mutation requires an `Idempotency-Key` header. MCP callers pass `idempotencyKey` in tool input instead. Generate one key per logical mutation and retain it unchanged with the original input for retries. Manual mutations except creation also require the latest release `expectedVersion`. Provider ingestion uses its event identity instead.

The record, action, audit event, and retry receipt commit atomically. Retry identity is scoped to the immutable project, authenticated actor or credential, operation, and key; independent projects do not share keys. Service account tokens and MCP grants have independent retry namespaces. Project transfers preserve retry identity while current organization access still governs replay. Receipts have no time-based expiry in this version, unlike the general API and MCP replay windows.

A completed retry returns the saved result without adding an action or evidence twice; changed input under the same key conflicts. Concurrent identical retries serialize and return the same saved result. Current authorization still applies to a replay. On a stale-version conflict, read again and decide whether a new operation is appropriate before submitting revised input with a new key. Do not blindly generate new keys after a timeout.

## create

Creates a release in `preparation` within one project and environment.

```ts theme={null}
// POST /api/v1/rpc/release/create · MCP release_create
create(input: ReleasePlan & { projectId: string; environmentId: string })
```

**Returns** the created release result in the API's `data` envelope.

**Errors.** Invalid or cross-project references are rejected. Creation does not create flags, PRs, or deployments.

## update

Replaces the plan before it is frozen.

```ts theme={null}
// POST /api/v1/rpc/release/update · MCP release_update
update(input: { releaseId: string; expectedVersion: number; plan: ReleasePlan })
```

**Returns** the updated release result.

**Errors.** A stale version or an attempt to revise a frozen plan conflicts.

## transition

Records a manual lifecycle transition and its reason.

```ts theme={null}
// POST /api/v1/rpc/release/transition · MCP release_transition
transition(input: {
  releaseId: string;
  expectedVersion: number;
  state: "preparation" | "awaiting_deployment" | "ready" | "rolling_out"
    | "paused" | "rolled_back" | "complete";
  note: string;
})
```

**Returns** the updated release result. It does not execute the named operational step.

**Errors.** Invalid transitions, missing readiness references, incomplete stages, and stale versions are rejected.

## completeStage

Records completion of the next planned stage.

```ts theme={null}
// POST /api/v1/rpc/release/completeStage · MCP release_completeStage
completeStage(input: {
  releaseId: string;
  expectedVersion: number;
  stageId: string;
  note: string;
})
```

**Returns** the updated release result.

**Errors.** The record must be `rolling_out` without an active controller authorization. Unknown, already completed, or out-of-order stages and stale versions are rejected. Manual stage completion records the operator's assessment.

## addEvidence

Appends evidence without editing earlier actions.

```ts theme={null}
// POST /api/v1/rpc/release/addEvidence · MCP release_addEvidence
addEvidence(input: {
  releaseId: string;
  expectedVersion: number;
  evidence:
    | { kind: "note"; text: string }
    | { kind: "link"; text: string; url: string };
  // text: nonempty, at most 8,000 characters
  // url: HTTPS, at most 2,048 characters, no credentials
})
```

**Returns** the updated release result, with its version incremented.

**Errors.** Invalid evidence and stale versions are rejected. Links require `url`; notes reject a `url` field. Evidence supports bounded notes and links, not arbitrary blobs or uploaded files. Links are not fetched or verified. Attached evidence containing credentials recognized by shipd's shared secret-redaction patterns is rejected before persistence, including recognized bearer tokens and credential-bearing query parameters. This is not an arbitrary-secret detector: do not put credentials, private telemetry payloads, or secrets in any release text or URL.

Accepted evidence is preserved after input trimming; existing MCP response redaction still applies and may normalize JSON-looking text or redact recognized secret-like content. Add a new note to correct a previous claim; do not treat a link as proof that its contents were checked.

## ingestEvidence

Appends a structured provider event using `POST /api/v1/rpc/release/ingestEvidence`. This automation endpoint uses the normal control-plane authentication and release write permissions.

```ts theme={null}
ingestEvidence(input: GitHubEvidenceEvent | SnapshotDeliveryObservation)

type GitHubEvidenceEvent = {
  releaseId: string;
  environmentId: string; // must match the release
  commitSha: string; // full lowercase SHA matching the release plan
  source: "github_actions" | "github_deployments";
  eventId: string; // immutable provider event identity
  kind: "ci" | "deployment" | "verification";
  subject: string; // component or check name
  occurredAt: string; // provider UTC timestamp
  outcome: "success" | "failure" | "cancelled" | "skipped"
    | "pending" | "in_progress" | "inactive" | "unknown";
  url: string; // HTTPS provider reference without credentials
}
```

**Returns** the updated release. No `expectedVersion` or `Idempotency-Key` is required. Event identity is scoped to project, release, source, and event ID, independent of the delivering credential. Identical events replay the original response without adding another action. Changed content under a used identity conflicts. Events, audit, and receipts commit atomically. Terminal releases accept ingestion. An ingested event alone cannot advance a stage.

**Errors.** Invalid scope, mismatched commit, recognized secrets, and invalid URLs are rejected. Source is provenance reported by an authenticated collector, not independent verification by shipd. Provider links are never fetched.

For `source: "sdk_delivery"`, call the same endpoint with an environment-bound service account. Send a service-wide observation for the release deployment. Use a distinct event ID for each observation and reuse it on retry.

```ts theme={null}
type SnapshotDeliveryObservation = {
  source: "sdk_delivery";
  releaseId: string;
  environmentId: string;
  commitSha: string;
  eventId: string;
  deploymentRef: string;
  service: string;
  observedAt: string;
  publishedVersion: number;
  appliedVersion: number | null;
  appliedSince: string | null;
  lastSuccessfulReadAt: string | null;
  lastFailedReadAt: string | null;
};
```

Use UTC timestamps with milliseconds. Report when the SDK began continuously serving the applied version. Use `null` when you cannot establish the applied version or the time it took effect. Successful polling, including a `304`, counts as a read during a stream reconnect. Report a snapshot read failure separately from a stream reconnect. Keep the observation limited to version and delivery metadata.

## startStage

Records when you started exposure for the current manual rollout stage. Call this after you verify the audience is exposed. Each stage has its own start, and resuming a paused release requires recording a new start.

```ts theme={null}
// POST /api/v1/rpc/release/startStage · MCP release_startStage
startStage(input: { releaseId: string; expectedVersion: number; stageId: string; note: string })
```

**Returns** the updated release and increments its version. Recording a start begins a new observation window.

**Errors.** A stale version, a stage out of order, or an active rollout controller conflicts. The release must be `rolling_out`.

## assessHealth

Records an advisory recommendation using the current stage's policy. Set the policy while planning the release, before it reaches `ready`.

```ts theme={null}
// POST /api/v1/rpc/release/assessHealth · MCP release_assessHealth
assessHealth(input: { releaseId: string; expectedVersion: number })

type ReleaseHealthPolicy = {
  version: string;
  observationSeconds: number;
  deploymentMaxAgeSeconds: number;
  snapshotMaxAgeSeconds: number;
  deployment: { source: "github_actions" | "github_deployments"; subject: string };
  verification?: { source: "github_actions" | "github_deployments"; subject: string }[];
  snapshotServices: string[];
  application: {
    connection: string;
    maxAgeSeconds: number; // age of the latest sample for each metric, at least 61 seconds
    baselineCommitSha?: string;
    cohort?: {
      tag: string; // Sentry span tag carrying cohort attribution
      exposedValues: string[]; // exposed cohort tag values
      controlValues?: string[]; // optional in-window control cohort tag values (mutually exclusive with baselineCommitSha)
    };
    guards: {
      metric: "error_rate" | "p95_latency";
      threshold: number;
      minSamples: number;
      maxBaselineIncrease?: number;
    }[];
  };
};
```

Set `deploymentRef` to the deployment evidence URL, and use the provider subjects in `evidence.latest` to select deployment and verification events. The full observation window must follow the recorded stage start and deployment, and the required services must have applied the current environment snapshot throughout. Sentry queries use the configured project observability connection (managed through `/api/v1/rpc/observabilityConnection/*` with `SENTRY_ROLLOUT_CONNECTIONS_JSON` fallback), environment slug, and exact release SHA. When `cohort` is configured, queries also scope to the exposed cohort tag values (and optional in-window control cohort values on the same release); if spans exist for the release without the configured cohort tag, the assessment records `cohortAttribution.status = "unavailable"` (`reason: "tag_missing"`) and holds with `application_attribution_unavailable`. When `cohort` is omitted, observations are release-wide (`attribution: "release"`) with `cohortAttribution.status = "unavailable"` (`reason: "not_configured"`). The window ends at least one minute before the assessment; when Sentry reports a healthy `completeThrough` watermark earlier than that cutoff, the assessor retries once with a complete window that still satisfies stage coverage and freshness limits, and records the actual evaluated window. When complete, fresh evidence is unavailable or Sentry reports stalled or unknown ingestion, the assessment yields `hold`. When ingestion metadata is omitted, the one-minute delay and sample freshness checks apply. The sample count uses observed spans with extrapolation disabled. `error_rate` is a fraction and `p95_latency` is in milliseconds. A baseline compares either another commit (`baselineCommitSha`) or a control cohort (`cohort.controlValues`) in the same environment and window. The release-level `sourceUrl` gives the scope, and each metric's `queries` identifies the requests used to calculate it.

**Returns** the release with its incremented version. Read `get` for the saved policy, scope, reasons, observation window, and evidence. The recommendation is `advance` when every check passes, `rollback` when complete evidence crosses a guard threshold, and `hold` when required evidence cannot establish a result. Operators decide whether to change exposure or complete a stage.

**Errors.** A missing stage policy, inactive release, active rollout controller, stale release version, or changed environment snapshot during evaluation conflicts.

## listHealthValidations

Lists accepted release health validations for a project. Filter optionally by environment, policy version, or revocation state.

```ts theme={null}
// POST /api/v1/rpc/release/listHealthValidations · MCP release_listHealthValidations
listHealthValidations(input: {
  projectId: string;
  environmentId?: string;
  policyVersion?: string;
  includeRevoked?: boolean;
})
```

**Returns** validation records with `id`, `environmentId`, `flagId`, `policyVersion`, `summary`, `scenarios`, `status` (`active`, `expired`, or `revoked`), and acceptance/revocation audit metadata.

## acceptHealthValidation

Records an operator-accepted health validation so opt-in releases in the target project and environment can authorize hosted rollout execution against that `policyVersion`. Requires project admin/owner authority (`release.health_validation.manage`, plus production toggle permission for production environments) from a user session or an environment-bound admin management API key; MCP grants and service accounts cannot self-accept validations.

```ts theme={null}
// POST /api/v1/rpc/release/acceptHealthValidation
acceptHealthValidation(input: {
  projectId: string;
  environmentId: string;
  flagId?: string;
  policyVersion: string;
  summary: string;
  scenarios: (
    | "healthy"
    | "regression"
    | "low_traffic"
    | "missing_telemetry"
    | "stale_telemetry"
    | "provider_outage"
    | "conflicting_evidence"
  )[];
  evidenceReleaseId?: string;
  evidenceActionIds?: string[];
  expiresAt?: string;
})
```

**Returns** the persisted validation record. Pass its `id` as `validationId` in `release/authorizeRollout`.

## revokeHealthValidation

Revokes an accepted release health validation. New authorizations using that `validationId` are rejected immediately, and active rollouts referencing it hold with `validation_unavailable` on their next check.

```ts theme={null}
// POST /api/v1/rpc/release/revokeHealthValidation
revokeHealthValidation(input: {
  projectId: string;
  validationId: string;
  reason: string;
})
```

**Returns** the updated validation record in `revoked` status.

## authorizeRollout

Opts a ready release in to the controller when an accepted health validation (`release/acceptHealthValidation`) matches the project, environment, optional flag scope, and `policyVersion`, and every authorized stage defines a `healthPolicy` with the same `version` and `observationSeconds >= observeForSeconds`. Use a service account token bound to the release's project and environment. Production requires production toggle permission.

```ts theme={null}
// POST /api/v1/rpc/release/authorizeRollout
authorizeRollout(input: {
  releaseId: string;
  expectedVersion: number;
  expectedFlagVersion: number;
  expectedFlagEnvironmentVersion: number;
  authorization: {
    flagId: string;
    maxPercentage: number;
    allowRollback: boolean;
    validationId: string;
    policyVersion: string;
    expiresAt: string;
    stages: {
      stageId: string;
      percentage: number;
      cohort: { kind: "all" } | { kind: "attribute"; attribute: string; values: string[] };
      observeForSeconds: number;
    }[];
  };
})
```

**Returns** the release in `rolling_out`. Read `get` for the active authorization, decisions, and publication results.

Attribute cohorts use exact text values. Numeric and boolean spellings such as `"001"` and `"true"` are rejected because SDK targeting can coerce them. The attribute name and values must have no surrounding whitespace.

**Errors.** The stages must form an ordered prefix of the plan and fit within the authorized percentage cap. The associated boolean flag must already serve explicit `false` control with no rules, draft, or pending review. Stale versions, missing validation, and insufficient permissions prevent authorization.

## controlRollout

Pauses or resumes controller checks, or stops automation and returns progression to manual actions.

```ts theme={null}
// POST /api/v1/rpc/release/controlRollout
controlRollout(input: {
  releaseId: string;
  expectedVersion: number;
  command: "pause" | "resume" | "stop";
  note: string;
})
```

**Returns** the updated release. Each command leaves the current published flag state in effect. Resuming runs a new assessment before any publication.

**Errors.** An inactive authorization or stale release version conflicts. Resuming requires an unexpired authorization. In production it also requires production toggle permission.

## get

Reads the release, action history, next actions, and remaining stages.

```ts theme={null}
// POST /api/v1/rpc/release/get · MCP release_get
get(input: { releaseId: string })
```

**Returns** a progress result with `release`, `actions`, `nextActions`, `remainingStages`, and `observed`. `evidence.latest` summarizes structured events for the current plan commit by source, kind, and subject. Provider occurrence time determines the latest result; receipt order does not. Contradictory events at the same timestamp yield `ambiguous`. Entries preserve their supporting events. All events remain in `actions[].payload.event`; action `createdAt` records receipt time. Missing evidence means unknown. These are last reported provider results for this release commit, not a live serving inventory across later releases.

`health` returns the latest assessment for the current stage and policy, or `null` when none exists. Use `health.recommendation` for the current decision. An expired assessment or one invalidated by a changed snapshot, a restarted stage, or adverse new evidence returns `hold` with `staleReason`. The original decision remains in the action history.

Release versions are independent of flag and deployment versions. Actions identify the authenticated actor, source, time, action type, and recorded payload; callers cannot supply an authoritative actor identity.

The `rollout` field gives the authorization, status, active stage, and next check. Controller decisions record their evidence separately from execution results. A `published` result includes the flag and snapshot revisions read back from the control plane. Client delivery and application health are evaluated in the subsequent assessment.

**Errors.** Missing or inaccessible records are not readable.

This version returns the entire action history in one response; actions do not have pagination or a retention policy. Keep evidence concise. List pagination below applies to release records, not their actions.

## list

Lists records within one authorized project and environment.

```ts theme={null}
// POST /api/v1/rpc/release/list · MCP release_list
list(input: {
  projectId: string;
  environmentId: string;
  limit?: number; // at most 100
  cursor?: string;
})
```

**Returns** `{ releases, nextCursor }`. Pass a non-null `nextCursor` as `cursor` to continue; null means the page is complete. Treat the cursor as opaque.

## Limits

Each controller authorization covers one boolean flag in the release's environment. The controller holds when evidence is missing or conflicting, the target changes, permission is lost, or an approval policy applies. For a protected change, stop automation before using the existing review and publication flow. A flag rollback restores control behavior. Migrations, purchases, and external side effects require their own recovery.

Related: [MCP tools](https://docs.useshipd.com/reference/mcp.md) · [Approval workflows](https://docs.useshipd.com/reference/approvals.md) · [Install shipd agent skills](https://docs.useshipd.com/operations/agent-skills.md).

## Code-defined progressive rollouts

The signal-driven controller uses the flag's pushed [`rollout` configuration](https://docs.useshipd.com/reference/config#signal-driven-rollout). It is gated by `code-release-control`. It stores a frozen checkpoint separately from legacy controller authorizations.

```ts theme={null}
// POST /api/v1/rpc/release/proposeProgressiveRollout
// MCP release_proposeProgressiveRollout
{ releaseId, flagId, expectedVersion }

// POST /api/v1/rpc/release/rolloutStatus
// MCP release_rolloutStatus or release_explainRolloutDecision
{ releaseId }

// POST /api/v1/rpc/release/controlProgressiveRollout
// Available through shipd rollout; unavailable through MCP
{ releaseId, expectedVersion, command: "pause" | "resume" | "abort", note }
```

**Returns** `{ releaseId, version, rollout }`. Status includes `nextCheckAt`. The rollout contains the frozen plan, zero-based step (`-1` before exposure), status, observation start, pending approval ID, and the most recent decision reason. When a guard query produces a metric snapshot, the decision also includes its window, values, samples and thresholds. Proposals, manual controls, and pre-exposure checks may have no metric snapshot. The release progress response includes the same public checkpoint as `progressive`. Every proposal, control, hold, advance, completion and rollback appends a release action and an audit event.

**Fallback.** Missing signals hold the current exposure and retry. A guard failure restores the configured default automatically without approval. The controller ignores advancement permissions for that safety action. Normal policy review and publication are required for a protected advance; agents cannot approve it. An active rollout prevents manual stage completion or config pushes. Manual pause continues guard checks.

**Errors.** Proposals require a ready release, published code-owned targeting serving the configured default with no rules, and one release stage per configured step. Another controller cannot own the same flag and environment. Plans, definitions or environment changes invalidate the checkpoint. Completion stops guard monitoring.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.