# Deploy API

Source: https://docs.autessa.com/docs/reference/deploy

> Autessa CDK: diff, deploy, roll back and pull a project in one tenant (deploy key) Generated from the Autessa OpenAPI spec.

# Deploy API

Autessa CDK: diff, deploy, roll back and pull a project in one tenant (deploy key)

- **Base URL:** `https://api.autessa.com`
- **Auth:** your API key in the `Authorization` header, with no `Bearer` prefix.
- **Guide:** [Deploy](/docs/cdk.md)
- **Status:** 0 live, 9 in preview. Preview operations are marked.

---

## Apply a manifest to a stage (idempotent, matched on logicalId); poll the deployment

(Preview)

**POST** `/clients/deploy/apply`

Idempotent, matched on logicalId; publishes draft to published. Deletes only with prune. Needs scope DEPLOY_APPLY.

This operation is in preview. Its shape may change before it is generally available.

**Request body**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `allowPhonePurchase` | boolean |  | The stage's allowPhonePurchase (see preview). Default false. |
| `drift` | string |  | Alias of permissionDrift |
| `idempotencyKey` | string | Yes | Retrying with the same key returns the first deployment (the Idempotency-Key header works too) |
| `manifest` | object | Yes |  |
| `manifestHash` | string |  |  |
| `permissionDrift` | REPORT \| RESET |  |  |
| `prune` | boolean |  |  |
| `stage` | string | Yes |  |
| `variables` | object |  |  |

**Response**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `changes` | array of Change |  |  |
| `deploymentId` | string |  |  |
| `error` | string |  |  |
| `finishedAt` | string |  | ISO-8601 time. |
| `kind` | string |  |  |
| `manifestHash` | string |  |  |
| `rollbackOfDeploymentId` | string |  |  |
| `stage` | string |  |  |
| `startedAt` | string |  | ISO-8601 time. |
| `status` | RUNNING \| SUCCEEDED \| FAILED \| ROLLED_BACK |  |  |

```bash
curl -X POST "https://api.autessa.com/clients/deploy/apply" \
  -H "Authorization: $AUTESSA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"manifest":{},"stage":"dev","idempotencyKey":"string"}'
```

---

## Deployments, newest first

(Preview)

**GET** `/clients/deploy/deployments`

This operation is in preview. Its shape may change before it is generally available.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `stage` | query | string |  |  |
| `limit` | query | integer |  |  |

**Response**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `items` | array of DeploymentResponse |  |  |
| `nextCursor` | string |  | Pass as cursor for the next page; absent or null on the last page. |

```bash
curl -X GET "https://api.autessa.com/clients/deploy/deployments" \
  -H "Authorization: $AUTESSA_API_KEY"
```

---

## One deployment: status, changes, error

(Preview)

**GET** `/clients/deploy/deployments/{deploymentId}`

This operation is in preview. Its shape may change before it is generally available.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `deploymentId` | path | string | Yes |  |

**Response**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `changes` | array of Change |  |  |
| `deploymentId` | string |  |  |
| `error` | string |  |  |
| `finishedAt` | string |  | ISO-8601 time. |
| `kind` | string |  |  |
| `manifestHash` | string |  |  |
| `rollbackOfDeploymentId` | string |  |  |
| `stage` | string |  |  |
| `startedAt` | string |  | ISO-8601 time. |
| `status` | RUNNING \| SUCCEEDED \| FAILED \| ROLLED_BACK |  |  |

```bash
curl -X GET "https://api.autessa.com/clients/deploy/deployments/V1StGXR8Z5" \
  -H "Authorization: $AUTESSA_API_KEY"
```

---

## Pull: export the tenant's resources as Manifest v2 plus source files

(Preview)

**GET** `/clients/deploy/export`

Needs scope DEPLOY_PULL.

This operation is in preview. Its shape may change before it is generally available.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `resources` | query | string |  | Comma-separated kinds (tables,tools,agents,managers,scheduledEvents,webhooks,mcpServers,apps); default all |
| `include` | query | string |  | source,apps |

**Response**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `downloadUrl` | string |  |  |

```bash
curl -X GET "https://api.autessa.com/clients/deploy/export" \
  -H "Authorization: $AUTESSA_API_KEY"
```

---

## Upload synth files, each part named sha256:<hex> of its content; files already stored are skipped

(Preview)

**POST** `/clients/deploy/files`

This operation is in preview. Its shape may change before it is generally available.

Also accepts `multipart/form-data`:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `empty` | boolean |  |  |

**Response**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `hashes` | array of string |  | Hashes stored (already present ones are skipped). |

```bash
curl -X POST "https://api.autessa.com/clients/deploy/files" \
  -H "Authorization: $AUTESSA_API_KEY"
```

---

## Which of these content hashes still need uploading

(Preview)

**GET** `/clients/deploy/files/missing`

This operation is in preview. Its shape may change before it is generally available.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `hashes` | query | string | Yes | Comma-separated sha256:<hex> hashes |

**Response**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `hashes` | array of string |  | Hashes stored (already present ones are skipped). |

```bash
curl -X GET "https://api.autessa.com/clients/deploy/files/missing" \
  -H "Authorization: $AUTESSA_API_KEY"
```

---

## Server-side diff of a manifest against a stage; flags every change that widens access

(Preview)

**POST** `/clients/deploy/preview`

Needs scope DEPLOY_DIFF.

This operation is in preview. Its shape may change before it is generally available.

**Request body**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `allowPhonePurchase` | boolean |  | The stage's allowPhonePurchase: let the deploy buy a phone number when no company number meets a PhoneNumber's requirement (the preview marks it WILL PURCHASE). Default false. |
| `drift` | string |  | Alias of permissionDrift |
| `manifest` | object | Yes | Manifest v2 (see GET /clients/deploy/schema) |
| `manifestHash` | string |  | Instead of manifest: the content hash of an uploaded manifest.json |
| `permissionDrift` | REPORT \| RESET |  | The stage's permissions.drift: REPORT (default) lists sharing changed outside the project; RESET puts it back to what the project declares |
| `prune` | boolean |  |  |
| `stage` | string | Yes |  |
| `variables` | object |  | Stage variables, resolved into {{name}} placeholders |

**Response**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `changes` | array of Change |  |  |
| `costBearing` | boolean |  |  |
| `driftedPermissions` | array of DriftedPermission |  |  |
| `warnings` | array of string |  |  |
| `widens` | boolean |  |  |

```bash
curl -X POST "https://api.autessa.com/clients/deploy/preview" \
  -H "Authorization: $AUTESSA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"manifest":{},"stage":"dev"}'
```

---

## Re-apply an earlier good manifest to a stage

(Preview)

**POST** `/clients/deploy/rollback`

Needs scope DEPLOY_ROLLBACK.

This operation is in preview. Its shape may change before it is generally available.

**Request body**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `stage` | string | Yes |  |
| `toDeploymentId` | string |  | Deployment to go back to; default = the last successful one before the current |

**Response**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `changes` | array of Change |  |  |
| `deploymentId` | string |  |  |
| `error` | string |  |  |
| `finishedAt` | string |  | ISO-8601 time. |
| `kind` | string |  |  |
| `manifestHash` | string |  |  |
| `rollbackOfDeploymentId` | string |  |  |
| `stage` | string |  |  |
| `startedAt` | string |  | ISO-8601 time. |
| `status` | RUNNING \| SUCCEEDED \| FAILED \| ROLLED_BACK |  |  |

```bash
curl -X POST "https://api.autessa.com/clients/deploy/rollback" \
  -H "Authorization: $AUTESSA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"stage":"dev"}'
```

---

## The Manifest v2 JSON Schema

(Preview)

**GET** `/clients/deploy/schema`

This operation is in preview. Its shape may change before it is generally available.

**Response**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `schema` | object |  |  |

```bash
curl -X GET "https://api.autessa.com/clients/deploy/schema" \
  -H "Authorization: $AUTESSA_API_KEY"
```

---

## Related

- [API reference overview](/docs/reference.md)
- [Errors and retries](/docs/reference.md#errors)
- [Deploy guide](/docs/cdk.md)

