# Redeploy an earlier version of a repository's app

- **OpenAPI Version:** `3.2.0`
- **API Version:** `3.1.0`
- **Contact:** Syndai <https://syndai.ai>

## Contents

**Operations**

- [POST /api/v1/external/coding/customers/{customer\_id}/repositories/{coding\_repository\_id}/publication/redeploy](#scalar-operation-post-apiv1externalcodingcustomerscustomer-idrepositoriescoding-repository-idpublicationredeploy)

**Schemas**

- [RedeployVersionRequest](#scalar-schema-redeployversionrequest)
- [PublicationResponse](#scalar-schema-publicationresponse)
- [AppPublicationRead](#scalar-schema-apppublicationread)
- [AppDeploymentRead](#scalar-schema-appdeploymentread)
- [ProblemDetail](#scalar-schema-problemdetail)
- [ExternalErrorCode](#scalar-schema-externalerrorcode)

<a id="scalar-context-global-servers"></a>

## Servers

- **URL:** `https://api.syndai.ai`

<a id="scalar-context-global-authentication"></a>

## Authentication

- **CustomerApiKey**: HTTP bearer (`API Key`)

  Customer API key sent as a bearer token

## Tags

### Apps

Beta: may change without notice. Publishing a repository as a hosted app: publish, unpublish, read and update a publication, its deployments, custom domain, runtime and monthly AI limit, and export its data or waitlist.

## Operations

<a id="scalar-operation-post-apiv1externalcodingcustomerscustomer-idrepositoriescoding-repository-idpublicationredeploy"></a>

### Redeploy an earlier version of a repository's app

- **Method:** `POST`
- **Path:** `/api/v1/external/coding/customers/{customer_id}/repositories/{coding_repository_id}/publication/redeploy`
- **Operation ID:** `redeployAppVersion`
- **Tags:** Apps

Deploys `sha`, one of this site's own deployments that went live, and pins the site to it (`pinned_sha`): while pinned, new commits do not redeploy it and every publish builds the pin. `POST .../publication/resume` clears it. Answers 202 with the publication while the deploy runs; charges nothing. Needs `coding:apps:publish`; 400 `VERSION_NOT_DEPLOYED` (the sha never went live here), 404 (never published), 409 `PUBLISH_IN_FLIGHT`.

**Servers:** [Inherited servers](#scalar-context-global-servers)

**Authentication:** [Global authentication](#scalar-context-global-authentication)

#### Path parameters

- **`customer_id` (required)**: `string`, format: `uuid`
- **`coding_repository_id` (required)**: `string`, format: `uuid`

#### Request body

**Required:** `true`

**Content type:** `application/json`

[RedeployVersionRequest](#scalar-schema-redeployversionrequest)

<a id="scalar-example-1"></a>

**Generated example:**

```json
{
  "sha": ""
}
```

#### Responses

##### 202 Request accepted, processing continues off-line

**Content type:** `application/json`

[PublicationResponse](#scalar-schema-publicationresponse)

<a id="scalar-example-2"></a>

**Generated example:**

```json
{
  "publication": {
    "accounts": true,
    "auto_redeploy": true,
    "feature_requests": "off",
    "feature_requests_autostart_on": false,
    "feature_requests_min_votes": 6,
    "generation": 1,
    "hosting": "syndai",
    "hosting_over_limit": false,
    "hosting_paid_cap_usd": 20,
    "hosting_paid_on": false,
    "hosting_usd_this_month": 1,
    "id": "",
    "latest_deployment": {
      "created_at": "",
      "error_cause": "",
      "error_kind": "",
      "error_message": "",
      "finished_at": "",
      "id": "",
      "sha": "",
      "status": "",
      "url": ""
    },
    "members": true,
    "operation_error_cause": "",
    "operation_error_kind": "",
    "operation_error_message": "",
    "pinned_sha": "",
    "search_visible": true,
    "signup": "",
    "site_languages_consent_current": false,
    "site_languages_max_usd": 0,
    "site_languages_paid_on": false,
    "site_languages_terms": "",
    "site_languages_usage_markup": 0,
    "slug": "",
    "state": "",
    "taps_counted": true,
    "url": "",
    "visitors": true,
    "writes_paused": true
  }
}
```

##### 400, 401, 403, 404, 409

- `400` Bad request syntax or unsupported method; or VERSION\_NOT\_DEPLOYED: that sha never went live on this site
- `401` Invalid or missing customer API key
- `403` Insufficient scope or forbidden customer access
- `404` Resource not found
- `409` PUBLISH\_IN\_FLIGHT: the app is already publishing

**Content type:** `application/problem+json`

[ProblemDetail](#scalar-schema-problemdetail)

RFC 7807 problem detail returned for public CaaS errors.

<a id="scalar-example-3"></a>

**Generated example:**

```json
{
  "code": "BUDGET_EXHAUSTED",
  "detail": null,
  "existing_run_id": null,
  "instance": null,
  "status": 1,
  "title": "",
  "type": "about:blank",
  "additionalProperty": "anything"
}
```

##### 429 Rate limit exceeded

**Headers:**

- **`Retry-After`**

  Seconds to wait before retrying the request

  `integer`

**Content type:** `application/problem+json`

[ProblemDetail](#scalar-schema-problemdetail)

RFC 7807 problem detail returned for public CaaS errors.

[Generated example](#scalar-example-3)

##### default Unexpected error

**Content type:** `application/problem+json`

[ProblemDetail](#scalar-schema-problemdetail)

<a id="scalar-example-4"></a>

**Generated example:**

```json
null
```

## Schemas

<a id="scalar-schema-redeployversionrequest"></a>

### RedeployVersionRequest

**Type:** `object`

- **`sha` (required)**: `string`, minLength: `7`, maxLength: `64`

<a id="scalar-example-5"></a>

**Generated example:**

```json
{
  "sha": ""
}
```

<a id="scalar-schema-publicationresponse"></a>

### PublicationResponse

**Type:** `object`

- **`publication`**: [AppPublicationRead](#scalar-schema-apppublicationread) | `null`

<a id="scalar-example-6"></a>

**Generated example:**

```json
{
  "publication": {
    "accounts": true,
    "auto_redeploy": true,
    "feature_requests": "off",
    "feature_requests_autostart_on": false,
    "feature_requests_min_votes": 6,
    "generation": 1,
    "hosting": "syndai",
    "hosting_over_limit": false,
    "hosting_paid_cap_usd": 20,
    "hosting_paid_on": false,
    "hosting_usd_this_month": 1,
    "id": "",
    "latest_deployment": {
      "created_at": "",
      "error_cause": "",
      "error_kind": "",
      "error_message": "",
      "finished_at": "",
      "id": "",
      "sha": "",
      "status": "",
      "url": ""
    },
    "members": true,
    "operation_error_cause": "",
    "operation_error_kind": "",
    "operation_error_message": "",
    "pinned_sha": "",
    "search_visible": true,
    "signup": "",
    "site_languages_consent_current": false,
    "site_languages_max_usd": 0,
    "site_languages_paid_on": false,
    "site_languages_terms": "",
    "site_languages_usage_markup": 0,
    "slug": "",
    "state": "",
    "taps_counted": true,
    "url": "",
    "visitors": true,
    "writes_paused": true
  }
}
```

<a id="scalar-schema-apppublicationread"></a>

### AppPublicationRead

**Type:** `object`

- **`auto_redeploy` (required)**: `boolean`
- **`generation` (required)**: `integer`
- **`hosting_usd_this_month` (required)**: `number`
- **`id` (required)**: `string`
- **`members` (required)**: `boolean`
- **`signup` (required)**: `string`
- **`slug` (required)**: `string`
- **`state` (required)**: `string`
- **`taps_counted` (required)**: `boolean`
- **`visitors` (required)**: `boolean`
- **`writes_paused` (required)**: `boolean`
- **`accounts`**: `boolean | null`
- **`feature_requests`**: `string`, default: `"off"`
- **`feature_requests_autostart_on`**: `boolean`, default: `false`
- **`feature_requests_min_votes`**: `integer`, default: `6`
- **`hosting`**: `string`, default: `"syndai"`
- **`hosting_over_limit`**: `boolean`, default: `false`
- **`hosting_paid_cap_usd`**: `number`, default: `20`
- **`hosting_paid_on`**: `boolean`, default: `false`
- **`latest_deployment`**: [AppDeploymentRead](#scalar-schema-appdeploymentread) | `null`
- **`operation_error_cause`**: `string | null`
- **`operation_error_kind`**: `string | null`
- **`operation_error_message`**: `string | null`
- **`pinned_sha`**: `string | null`
- **`search_visible`**: `boolean | null`
- **`site_languages_consent_current`**: `boolean`, default: `false`
- **`site_languages_max_usd`**: `number`, default: `0`
- **`site_languages_paid_on`**: `boolean`, default: `false`
- **`site_languages_terms`**: `string`, default: `""`
- **`site_languages_usage_markup`**: `number`, default: `0`
- **`url`**: `string | null`

<a id="scalar-example-7"></a>

**Generated example:**

```json
{
  "accounts": true,
  "auto_redeploy": true,
  "feature_requests": "off",
  "feature_requests_autostart_on": false,
  "feature_requests_min_votes": 6,
  "generation": 1,
  "hosting": "syndai",
  "hosting_over_limit": false,
  "hosting_paid_cap_usd": 20,
  "hosting_paid_on": false,
  "hosting_usd_this_month": 1,
  "id": "",
  "latest_deployment": {
    "created_at": "",
    "error_cause": "",
    "error_kind": "",
    "error_message": "",
    "finished_at": "",
    "id": "",
    "sha": "",
    "status": "",
    "url": ""
  },
  "members": true,
  "operation_error_cause": "",
  "operation_error_kind": "",
  "operation_error_message": "",
  "pinned_sha": "",
  "search_visible": true,
  "signup": "",
  "site_languages_consent_current": false,
  "site_languages_max_usd": 0,
  "site_languages_paid_on": false,
  "site_languages_terms": "",
  "site_languages_usage_markup": 0,
  "slug": "",
  "state": "",
  "taps_counted": true,
  "url": "",
  "visitors": true,
  "writes_paused": true
}
```

<a id="scalar-schema-appdeploymentread"></a>

### AppDeploymentRead

**Type:** `object`

- **`created_at` (required)**: `string`
- **`id` (required)**: `string`
- **`status` (required)**: `string`
- **`error_cause`**: `string | null`
- **`error_kind`**: `string | null`
- **`error_message`**: `string | null`
- **`finished_at`**: `string | null`
- **`sha`**: `string | null`
- **`url`**: `string | null`

<a id="scalar-example-8"></a>

**Generated example:**

```json
{
  "created_at": "",
  "error_cause": "",
  "error_kind": "",
  "error_message": "",
  "finished_at": "",
  "id": "",
  "sha": "",
  "status": "",
  "url": ""
}
```

<a id="scalar-schema-problemdetail"></a>

### ProblemDetail

**Type:** `object`

RFC 7807 problem detail returned for public CaaS errors.

- **`code` (required)**: `string`, possible values: `"BUDGET_EXHAUSTED", "QUOTA_EXCEEDED", "RUN_CONCURRENCY_LIMIT", "CUSTOMER_DISABLED", "REPO_NOT_BOUND", "IDEMPOTENCY_REPLAY", "CONFLICT", "MISSION_BUSY_RETRY", "HITL_REQUEST_CONFLICT", "HITL_REQUEST_SETTLED", "RUN_TERMINATED_BEFORE_RESPONSE", "INVALID_POLICY", "INVALID_SCOPE", "RATE_LIMITED", "INSTALLATION_INCOMPLETE", "SUBSCRIPTION_USAGE_UNAVAILABLE", "INVALID_TOKEN", "ROLE_REQUIRED", "PLAN_UPGRADE_REQUIRED", "EMAIL_MISMATCH", "EXPIRED_TOKEN", "NOT_FOUND", "OVERSCOPE_ACK_REQUIRED", "VERIFY_FAILED", "PUBLISH_IN_FLIGHT", "PUBLISH_UNSUPPORTED_REPO", "PUBLICATION_NOT_LIVE", "NO_APP_DATA", "FEATURE_REQUESTS_NEEDS_MEMBERS", "EMPTY_UPDATE", "BAD_CURSOR", "HUMAN_APPROVAL_REQUIRED", "PROTECTED_PATHS_MANAGED_ONLY", "RUN_IN_FLIGHT", "TEXT_EDIT_REFUSED", "CLI_UPGRADE_REQUIRED", "PRODUCTION_STEP_UP_REQUIRED", "PRICES_UPDATING", "GITHUB_UNAVAILABLE", "PUBLISH_NOT_SET_UP", "VERSION_NOT_DEPLOYED", "INTERNAL_ERROR"`

  Stable error codes surfaced to public CaaS clients.
- **`status` (required)**: `integer`
- **`title` (required)**: `string`
- **`detail`**: `string | null`, default: `null`
- **`existing_run_id`**: `string | null`, default: `null`
- **`instance`**: `string | null`, default: `null`
- **`type`**: `string`, default: `"about:blank"`

<a id="scalar-example-9"></a>

**Generated example:**

```json
{
  "code": "BUDGET_EXHAUSTED",
  "detail": null,
  "existing_run_id": null,
  "instance": null,
  "status": 1,
  "title": "",
  "type": "about:blank",
  "additionalProperty": "anything"
}
```

<a id="scalar-schema-externalerrorcode"></a>

### ExternalErrorCode

**Type:** `string`, possible values: `"BUDGET_EXHAUSTED", "QUOTA_EXCEEDED", "RUN_CONCURRENCY_LIMIT", "CUSTOMER_DISABLED", "REPO_NOT_BOUND", "IDEMPOTENCY_REPLAY", "CONFLICT", "MISSION_BUSY_RETRY", "HITL_REQUEST_CONFLICT", "HITL_REQUEST_SETTLED", "RUN_TERMINATED_BEFORE_RESPONSE", "INVALID_POLICY", "INVALID_SCOPE", "RATE_LIMITED", "INSTALLATION_INCOMPLETE", "SUBSCRIPTION_USAGE_UNAVAILABLE", "INVALID_TOKEN", "ROLE_REQUIRED", "PLAN_UPGRADE_REQUIRED", "EMAIL_MISMATCH", "EXPIRED_TOKEN", "NOT_FOUND", "OVERSCOPE_ACK_REQUIRED", "VERIFY_FAILED", "PUBLISH_IN_FLIGHT", "PUBLISH_UNSUPPORTED_REPO", "PUBLICATION_NOT_LIVE", "NO_APP_DATA", "FEATURE_REQUESTS_NEEDS_MEMBERS", "EMPTY_UPDATE", "BAD_CURSOR", "HUMAN_APPROVAL_REQUIRED", "PROTECTED_PATHS_MANAGED_ONLY", "RUN_IN_FLIGHT", "TEXT_EDIT_REFUSED", "CLI_UPGRADE_REQUIRED", "PRODUCTION_STEP_UP_REQUIRED", "PRICES_UPDATING", "GITHUB_UNAVAILABLE", "PUBLISH_NOT_SET_UP", "VERSION_NOT_DEPLOYED", "INTERNAL_ERROR"`

Stable error codes surfaced to public CaaS clients.
