# Update a repository's settings

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

## Contents

**Operations**

- [PATCH /api/v1/external/coding/repos/{coding\_repository\_id}](#scalar-operation-patch-apiv1externalcodingreposcoding-repository-id)

**Schemas**

- [CodingRepositoryUpdateRequest](#scalar-schema-codingrepositoryupdaterequest)
- [CodingRepositoryRead](#scalar-schema-codingrepositoryread)
- [RepositoryGithubDeployRead](#scalar-schema-repositorygithubdeployread)
- [RepositoryStoreRead](#scalar-schema-repositorystoreread)
- [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

### Repositories

The repositories connected to your workspace. List them, change a repository's settings, and make or undo a direct text edit on a live site without starting a full run.

## Operations

<a id="scalar-operation-patch-apiv1externalcodingreposcoding-repository-id"></a>

### Update a repository's settings

- **Method:** `PATCH`
- **Path:** `/api/v1/external/coding/repos/{coding_repository_id}`
- **Operation ID:** `updateRepo`
- **Tags:** Repositories

Changes any of `display_name` (the label only; clone URLs and app addresses keep the provider's name), `protected_paths`, `trust_owner_changes` and `allow_automation_changes`; omitted fields are unchanged and an empty body is 400 `EMPTY_UPDATE`. Protected files and owner trust work on Syndai-hosted projects only (422 otherwise). An API key may only add protected patterns; loosening them or flipping owner trust is 403 `HUMAN_APPROVAL_REQUIRED`. `allow_automation_changes` needs a signed-in workspace owner and the current `expected_updated_at` (409 when stale). 404 for a repository that is not yours.

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

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

#### Path parameters

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

#### Query parameters

- **`customer_id`**: `string | null`, format: `uuid`

#### Request body

**Required:** `true`

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

[CodingRepositoryUpdateRequest](#scalar-schema-codingrepositoryupdaterequest)

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

**Generated example:**

```json
{
  "allow_automation_changes": true,
  "display_name": "",
  "expected_updated_at": "",
  "protected_paths": [
    ""
  ],
  "trust_owner_changes": true
}
```

#### Responses

##### 200 Request fulfilled, document follows

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

[CodingRepositoryRead](#scalar-schema-codingrepositoryread)

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

**Generated example:**

```json
{
  "allow_automation_changes": false,
  "capabilities": {
    "additionalProperty": "anything"
  },
  "clone_url": "",
  "created_at": "",
  "customer_id": "",
  "default_branch": "",
  "display_name": "",
  "full_name": "",
  "github_deploy": {
    "at": "",
    "environment": "",
    "state": "",
    "url": ""
  },
  "html_url": "",
  "id": "",
  "protected_paths": [
    ""
  ],
  "provider": "",
  "repo_url": "",
  "status": "",
  "store": {
    "needs": "",
    "needs_owner": true,
    "state": "",
    "version": ""
  },
  "trust_owner_changes": true,
  "updated_at": ""
}
```

##### 400, 401, 403, 404, 422

- `400` Bad request syntax or unsupported method; or EMPTY\_UPDATE, or an invalid protected-file pattern
- `401` Invalid or missing customer API key
- `403` Insufficient scope or forbidden customer access; or HUMAN\_APPROVAL\_REQUIRED: a key may only append plain patterns
- `404` Resource not found
- `422` PROTECTED\_PATHS\_MANAGED\_ONLY: a GitHub repository

**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-codingrepositoryupdaterequest"></a>

### CodingRepositoryUpdateRequest

**Type:** `object`

- **`allow_automation_changes`**: `boolean`
- **`display_name`**: `string | null`
- **`expected_updated_at`**: `string`
- **`protected_paths`**: `array of string`
- **`trust_owner_changes`**: `boolean`

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

**Generated example:**

```json
{
  "allow_automation_changes": true,
  "display_name": "",
  "expected_updated_at": "",
  "protected_paths": [
    ""
  ],
  "trust_owner_changes": true
}
```

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

### CodingRepositoryRead

**Type:** `object`

- **`capabilities` (required)**: `object`
- **`clone_url` (required)**: `string`
- **`created_at` (required)**: `string`, format: `date-time`
- **`default_branch` (required)**: `string`
- **`full_name` (required)**: `string`
- **`id` (required)**: `string`, format: `uuid`
- **`protected_paths` (required)**: `array of string`
- **`provider` (required)**: `string`
- **`repo_url` (required)**: `string`
- **`status` (required)**: `string`
- **`updated_at` (required)**: `string`, format: `date-time`
- **`allow_automation_changes`**: `boolean`, default: `false`
- **`customer_id`**: `string | null`, format: `uuid`
- **`display_name`**: `string | null`
- **`github_deploy`**: [RepositoryGithubDeployRead](#scalar-schema-repositorygithubdeployread) | `null`
- **`html_url`**: `string | null`
- **`store`**: [RepositoryStoreRead](#scalar-schema-repositorystoreread) | `null`
- **`trust_owner_changes`**: `boolean`, default: `true`

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

**Generated example:**

```json
{
  "allow_automation_changes": false,
  "capabilities": {
    "additionalProperty": "anything"
  },
  "clone_url": "",
  "created_at": "",
  "customer_id": "",
  "default_branch": "",
  "display_name": "",
  "full_name": "",
  "github_deploy": {
    "at": "",
    "environment": "",
    "state": "",
    "url": ""
  },
  "html_url": "",
  "id": "",
  "protected_paths": [
    ""
  ],
  "provider": "",
  "repo_url": "",
  "status": "",
  "store": {
    "needs": "",
    "needs_owner": true,
    "state": "",
    "version": ""
  },
  "trust_owner_changes": true,
  "updated_at": ""
}
```

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

### RepositoryGithubDeployRead

**Type:** `object`

- **`at` (required)**: `string`, format: `date-time`
- **`environment` (required)**: `string`
- **`state` (required)**: `string`
- **`url`**: `string | null`

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

**Generated example:**

```json
{
  "at": "",
  "environment": "",
  "state": "",
  "url": ""
}
```

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

### RepositoryStoreRead

**Type:** `object`

- **`needs_owner` (required)**: `boolean`
- **`state` (required)**: `string`
- **`needs`**: `string | null`
- **`version`**: `string | null`

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

**Generated example:**

```json
{
  "needs": "",
  "needs_owner": true,
  "state": "",
  "version": ""
}
```

<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.
