# Apply workspace source (/api-reference/workflows/applyWorkspaceSource)

`POST /api/v2/workspaces/{workspaceId}/source`

Apply a workspace source directory: create and update what it declares, in dependency order (custom tools, skills, tables, knowledge bases and files before the workflows that use them). Send the files of every managed kind, `kinds` (the kind folders the directory holds), the binary-file manifest (path, SHA-256 and size), and the `base` from Get Workspace Source. Binary bytes are staged first and the apply names them by hash: `sim workspaces source apply` stages them itself, and other clients find the ones the server lacks (Find Missing Workspace Source Blobs) and upload them to `POST /api/v2/workspaces/{workspaceId}/source/blobs`, a binary upload MCP clients cannot send. A directory without binary files needs no staging; a write whose bytes are not staged refuses the whole apply with `E_BLOB_MISSING` before anything is written, and a dry run lists those paths in `needBlobs`. Requires workspace write access.

The whole plan is checked and authorized before anything is written: any error returns `400` with `details.code` `SOURCE_REJECTED` and `details.diagnostics` (each with a file, line and column), and nothing is written. A resource changed on the server since the directory was read returns `409` (`SOURCE_STALE`); another apply still writing the workspace `409` (`SOURCE_BUSY`: nothing was written, apply again once it finished; a dry run never waits on one); a schema-locked table `423`; a directory over a size limit `413` (at most 500 resources per kind, 100 workflows and 1000 changes per apply). A resource, table column or option the directory no longer declares is deleted only with `options.allowDelete`; without it, deleting one the base records is refused, and a server resource the base never recorded is kept with a warning. Each change is written by the operation that owns it and audited by it; workflow, skill, secret and deployment changes follow use cases a workspace API key cannot call, so a workspace API key gets `E_APPLY_FORBIDDEN` for those kinds (narrow the apply with `options.only`). Writes commit one by one: a write that fails mid-apply answers `200` with `failed` and the changes written before it, and applying the same directory again continues. The response carries the files re-printed from what was saved and the next `base`. `dryRun=true` plans, checks and authorizes without writing and answers `200` with the findings in `diagnostics`. Returns `403` while workflows as code is not enabled.

OAuth scope: `api:write`.

## Authentication

```json

{
  "requirements": [
    {
      "apiKey": []
    },
    {
      "oauthBearer": [
        "api:write"
      ]
    }
  ],
  "schemes": {
    "apiKey": {
      "type": "apiKey",
      "in": "header",
      "name": "X-API-Key",
      "description": "Send a personal or workspace API key in `X-API-Key`. See [key types and access](https://docs.sim.ai/api-reference/authentication#key-types); operations that reject workspace keys say so in their description."
    },
    "oauthBearer": {
      "type": "oauth2",
      "description": "Send a Sim OAuth access token in `Authorization: Bearer`. See [OAuth authentication and scopes](https://docs.sim.ai/api-reference/authentication#oauth-access-tokens).",
      "flows": {
        "authorizationCode": {
          "authorizationUrl": "https://www.sim.ai/api/auth/oauth2/authorize",
          "tokenUrl": "https://www.sim.ai/api/auth/oauth2/token",
          "refreshUrl": "https://www.sim.ai/api/auth/oauth2/token",
          "scopes": {
            "api:read": "Read your workspaces, workflows, files, tables, and logs",
            "api:write": "Read, create, change, run, and delete resources in your workspaces",
            "offline_access": "Stay signed in without asking again"
          }
        }
      }
    }
  }
}

```

Required OAuth scope: `api:write`.

## Request examples

### cURL

```bash
curl --request POST 'https://www.sim.ai/api/v2/workspaces/string/source' \
  --header 'X-API-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "files": {
    "tables/leads.ts": "// @sim-sdk 1\nimport { column, defineTable } from '"'"'@sim/workflow-sdk/workspace'"'"'\n\nexport default defineTable({\n  name: '"'"'leads'"'"',\n  columns: {\n    email: column.string({ required: true, unique: true }),\n    status: column.select({ options: ['"'"'new'"'"', '"'"'won'"'"'] }),\n  },\n})\n"
  },
  "kinds": [
    "table"
  ],
  "base": {
    "version": 1,
    "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64",
    "resources": {
      "table:leads": {
        "id": "tbl_5c0e2a7b9d1f4e3a8b6c2d0f7e9a1b3c",
        "fingerprint": "rf1:4b8d2f6a0c3e7b1d5f9a2c6e0b4d8f3a7c1e5b9d2f6a0c4e8b3d7f1a5c9e2b6d",
        "columns": {
          "email": {
            "id": "col_8e1c4a7b2d5f"
          },
          "status": {
            "id": "col_3b6d9f2a5c8e",
            "options": {
              "new": "k2Pq9x",
              "won": "r7Tn4m"
            }
          }
        }
      }
    }
  }
}'
```

### JavaScript

```javascript
const response = await fetch("https://www.sim.ai/api/v2/workspaces/string/source", {
  "method": "POST",
  "headers": {
    "X-API-Key": "YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  "body": "{\n  \"files\": {\n    \"tables/leads.ts\": \"// @sim-sdk 1\\nimport { column, defineTable } from '@sim/workflow-sdk/workspace'\\n\\nexport default defineTable({\\n  name: 'leads',\\n  columns: {\\n    email: column.string({ required: true, unique: true }),\\n    status: column.select({ options: ['new', 'won'] }),\\n  },\\n})\\n\"\n  },\n  \"kinds\": [\n    \"table\"\n  ],\n  \"base\": {\n    \"version\": 1,\n    \"workspaceId\": \"a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64\",\n    \"resources\": {\n      \"table:leads\": {\n        \"id\": \"tbl_5c0e2a7b9d1f4e3a8b6c2d0f7e9a1b3c\",\n        \"fingerprint\": \"rf1:4b8d2f6a0c3e7b1d5f9a2c6e0b4d8f3a7c1e5b9d2f6a0c4e8b3d7f1a5c9e2b6d\",\n        \"columns\": {\n          \"email\": {\n            \"id\": \"col_8e1c4a7b2d5f\"\n          },\n          \"status\": {\n            \"id\": \"col_3b6d9f2a5c8e\",\n            \"options\": {\n              \"new\": \"k2Pq9x\",\n              \"won\": \"r7Tn4m\"\n            }\n          }\n        }\n      }\n    }\n  }\n}"
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const result = await response.json();
```

### Python

```python
import requests

response = requests.request(
    "POST",
    "https://www.sim.ai/api/v2/workspaces/string/source",
    headers={
  "X-API-Key": "YOUR_API_KEY",
  "Content-Type": "application/json"
},
    data="{\n  \"files\": {\n    \"tables/leads.ts\": \"// @sim-sdk 1\\nimport { column, defineTable } from '@sim/workflow-sdk/workspace'\\n\\nexport default defineTable({\\n  name: 'leads',\\n  columns: {\\n    email: column.string({ required: true, unique: true }),\\n    status: column.select({ options: ['new', 'won'] }),\\n  },\\n})\\n\"\n  },\n  \"kinds\": [\n    \"table\"\n  ],\n  \"base\": {\n    \"version\": 1,\n    \"workspaceId\": \"a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64\",\n    \"resources\": {\n      \"table:leads\": {\n        \"id\": \"tbl_5c0e2a7b9d1f4e3a8b6c2d0f7e9a1b3c\",\n        \"fingerprint\": \"rf1:4b8d2f6a0c3e7b1d5f9a2c6e0b4d8f3a7c1e5b9d2f6a0c4e8b3d7f1a5c9e2b6d\",\n        \"columns\": {\n          \"email\": {\n            \"id\": \"col_8e1c4a7b2d5f\"\n          },\n          \"status\": {\n            \"id\": \"col_3b6d9f2a5c8e\",\n            \"options\": {\n              \"new\": \"k2Pq9x\",\n              \"won\": \"r7Tn4m\"\n            }\n          }\n        }\n      }\n    }\n  }\n}",
)
response.raise_for_status()
result = response.json()
```

### Go

```go
package main

import (
  "io"
  "net/http"
  "os"
  "strings"
)

func check(err error) {
  if err != nil { panic(err) }
}

func must[T any](value T, err error) T {
  check(err)
  return value
}

func main() {

  request := must(http.NewRequest("POST", "https://www.sim.ai/api/v2/workspaces/string/source", strings.NewReader("{\n  \"files\": {\n    \"tables/leads.ts\": \"// @sim-sdk 1\\nimport { column, defineTable } from '@sim/workflow-sdk/workspace'\\n\\nexport default defineTable({\\n  name: 'leads',\\n  columns: {\\n    email: column.string({ required: true, unique: true }),\\n    status: column.select({ options: ['new', 'won'] }),\\n  },\\n})\\n\"\n  },\n  \"kinds\": [\n    \"table\"\n  ],\n  \"base\": {\n    \"version\": 1,\n    \"workspaceId\": \"a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64\",\n    \"resources\": {\n      \"table:leads\": {\n        \"id\": \"tbl_5c0e2a7b9d1f4e3a8b6c2d0f7e9a1b3c\",\n        \"fingerprint\": \"rf1:4b8d2f6a0c3e7b1d5f9a2c6e0b4d8f3a7c1e5b9d2f6a0c4e8b3d7f1a5c9e2b6d\",\n        \"columns\": {\n          \"email\": {\n            \"id\": \"col_8e1c4a7b2d5f\"\n          },\n          \"status\": {\n            \"id\": \"col_3b6d9f2a5c8e\",\n            \"options\": {\n              \"new\": \"k2Pq9x\",\n              \"won\": \"r7Tn4m\"\n            }\n          }\n        }\n      }\n    }\n  }\n}")))
  request.Header.Set("X-API-Key", "YOUR_API_KEY")
  request.Header.Set("Content-Type", "application/json")
  response := must(http.DefaultClient.Do(request))
  defer response.Body.Close()
  if response.StatusCode >= 400 { panic(response.Status) }
  must(io.Copy(os.Stdout, response.Body))
}
```

### Java

```java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Example {
  public static void main(String[] args) throws Exception {
    var builder = HttpRequest.newBuilder(URI.create("https://www.sim.ai/api/v2/workspaces/string/source"));
    builder.header("X-API-Key", "YOUR_API_KEY");
    builder.header("Content-Type", "application/json");
    var request = builder.method("POST", HttpRequest.BodyPublishers.ofString("{\n  \"files\": {\n    \"tables/leads.ts\": \"// @sim-sdk 1\\nimport { column, defineTable } from '@sim/workflow-sdk/workspace'\\n\\nexport default defineTable({\\n  name: 'leads',\\n  columns: {\\n    email: column.string({ required: true, unique: true }),\\n    status: column.select({ options: ['new', 'won'] }),\\n  },\\n})\\n\"\n  },\n  \"kinds\": [\n    \"table\"\n  ],\n  \"base\": {\n    \"version\": 1,\n    \"workspaceId\": \"a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64\",\n    \"resources\": {\n      \"table:leads\": {\n        \"id\": \"tbl_5c0e2a7b9d1f4e3a8b6c2d0f7e9a1b3c\",\n        \"fingerprint\": \"rf1:4b8d2f6a0c3e7b1d5f9a2c6e0b4d8f3a7c1e5b9d2f6a0c4e8b3d7f1a5c9e2b6d\",\n        \"columns\": {\n          \"email\": {\n            \"id\": \"col_8e1c4a7b2d5f\"\n          },\n          \"status\": {\n            \"id\": \"col_3b6d9f2a5c8e\",\n            \"options\": {\n              \"new\": \"k2Pq9x\",\n              \"won\": \"r7Tn4m\"\n            }\n          }\n        }\n      }\n    }\n  }\n}")).build();
    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofInputStream());
    try (var body = response.body()) {
      if (response.statusCode() >= 400) throw new IllegalStateException("HTTP " + response.statusCode());
      body.transferTo(System.out);
    }
  }
}
```

### C#

```csharp
using System;
using System.IO;
using System.Net.Http;
using System.Text;

using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("POST"), "https://www.sim.ai/api/v2/workspaces/string/source");
request.Content = new StringContent("{\n  \"files\": {\n    \"tables/leads.ts\": \"// @sim-sdk 1\\nimport { column, defineTable } from '@sim/workflow-sdk/workspace'\\n\\nexport default defineTable({\\n  name: 'leads',\\n  columns: {\\n    email: column.string({ required: true, unique: true }),\\n    status: column.select({ options: ['new', 'won'] }),\\n  },\\n})\\n\"\n  },\n  \"kinds\": [\n    \"table\"\n  ],\n  \"base\": {\n    \"version\": 1,\n    \"workspaceId\": \"a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64\",\n    \"resources\": {\n      \"table:leads\": {\n        \"id\": \"tbl_5c0e2a7b9d1f4e3a8b6c2d0f7e9a1b3c\",\n        \"fingerprint\": \"rf1:4b8d2f6a0c3e7b1d5f9a2c6e0b4d8f3a7c1e5b9d2f6a0c4e8b3d7f1a5c9e2b6d\",\n        \"columns\": {\n          \"email\": {\n            \"id\": \"col_8e1c4a7b2d5f\"\n          },\n          \"status\": {\n            \"id\": \"col_3b6d9f2a5c8e\",\n            \"options\": {\n              \"new\": \"k2Pq9x\",\n              \"won\": \"r7Tn4m\"\n            }\n          }\n        }\n      }\n    }\n  }\n}", Encoding.UTF8);
request.Headers.TryAddWithoutValidation("X-API-Key", "YOUR_API_KEY");
request.Content!.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
using var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);
response.EnsureSuccessStatusCode();
await response.Content.CopyToAsync(Console.OpenStandardOutput());
```

## Parameters

```json

[
  {
    "name": "workspaceId",
    "in": "path",
    "required": true,
    "description": "Workspace to read or apply.",
    "schema": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128,
      "description": "Workspace to read or apply."
    }
  },
  {
    "name": "dryRun",
    "in": "query",
    "required": false,
    "description": "Plan, check and authorize every change without writing. Findings, errors included, come back in `diagnostics` with a `200`.",
    "schema": {
      "description": "Plan, check and authorize every change without writing. Findings, errors included, come back in `diagnostics` with a `200`.",
      "type": "boolean"
    }
  }
]

```

## Request body

```json

{
  "required": true,
  "description": "The directory files, its managed kinds and the base they were read with.",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "files": {
            "type": "object",
            "propertyNames": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            },
            "additionalProperties": {
              "type": "string"
            },
            "description": "Directory path → text for every managed kind: declarations (`tables/leads.ts`) and workflow folders (`workflows/ingest/workflow.ts`, `functions/*`, `.sim/lock.json`, `.sim/base.json`). A workflow folder sent with only its `.sim/base.json` is unchanged."
          },
          "blobs": {
            "description": "Binary files by path, with the SHA-256 and size of their bytes. Their bytes must be staged first: `sim workspaces source apply` stages them, or upload them to `POST /api/v2/workspaces/{workspaceId}/source/blobs` (not available over MCP). An apply with any missing is refused with `E_BLOB_MISSING` and writes nothing.",
            "maxItems": 20000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1024,
                  "description": "Directory path of the binary file."
                },
                "sha256": {
                  "type": "string",
                  "pattern": "^[0-9a-f]{64}$",
                  "description": "SHA-256 of the bytes, lowercase hex."
                },
                "size": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 10000000,
                  "description": "Bytes."
                }
              },
              "required": [
                "path",
                "sha256",
                "size"
              ],
              "additionalProperties": false
            }
          },
          "base": {
            "type": "object",
            "properties": {
              "version": {
                "type": "number",
                "const": 1,
                "description": "Base format version."
              },
              "workspaceId": {
                "type": "string",
                "description": "Workspace the directory was read from."
              },
              "resources": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Stored id the key is bound to."
                    },
                    "fingerprint": {
                      "description": "`rf1:` fingerprint of the resource as last read; absent for a workflow, and for a binary file listed without `sha256` until the client records its hash.",
                      "type": "string"
                    },
                    "columns": {
                      "description": "Table column key → stored column.",
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Stored column id."
                          },
                          "options": {
                            "description": "Select option name → option id.",
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {
                              "type": "string"
                            }
                          }
                        },
                        "required": [
                          "id"
                        ]
                      }
                    },
                    "blobs": {
                      "description": "Binary file name → its stored id, revision and hash as last read.",
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Stored id of the binary file."
                          },
                          "rev": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "string"
                              }
                            ],
                            "description": "Content revision as last read."
                          },
                          "sha256": {
                            "type": "string",
                            "pattern": "^[0-9a-f]{64}$",
                            "description": "SHA-256 of the bytes, lowercase hex."
                          }
                        },
                        "required": [
                          "id",
                          "rev",
                          "sha256"
                        ]
                      }
                    },
                    "rows": {
                      "description": "A table’s managed rows, as last read.",
                      "type": "object",
                      "properties": {
                        "fingerprint": {
                          "type": "string",
                          "description": "`rf1:` fingerprint of the managed rows as last read."
                        },
                        "version": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991,
                          "description": "The table’s row version as last read; it moves on every row write."
                        }
                      },
                      "required": [
                        "fingerprint",
                        "version"
                      ],
                      "additionalProperties": {
                        "description": "An `x-` extension field, kept as written."
                      }
                    }
                  },
                  "required": [
                    "id"
                  ],
                  "additionalProperties": {
                    "description": "An `x-` extension field, kept as written."
                  },
                  "description": "One resource in the base."
                },
                "description": "`kind:key` → the stored resource and its fingerprint."
              }
            },
            "required": [
              "version",
              "workspaceId",
              "resources"
            ],
            "additionalProperties": {
              "description": "An `x-` extension field, kept as written."
            },
            "description": "`.sim/base.json`: per resource, the id and fingerprint the directory was read at. Apply compares it with the server to tell a local edit from a server change."
          },
          "kinds": {
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "secret",
                "credential",
                "custom-tool",
                "skill",
                "mcp-server",
                "table",
                "knowledge-base",
                "file",
                "workflow",
                "deployment"
              ],
              "description": "A resource kind: `secret`, `credential`, `custom-tool`, `skill`, `mcp-server`, `table`, `knowledge-base`, `file`, `workflow`, `deployment`."
            },
            "description": "The kind folders the directory holds, empty ones included. A kind is managed only when listed here or when a file of it is sent."
          },
          "options": {
            "description": "How far the apply may go.",
            "type": "object",
            "properties": {
              "allowDelete": {
                "description": "Delete resources, columns and data the directory no longer declares.",
                "type": "boolean"
              },
              "only": {
                "description": "Apply only these kinds.",
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "secret",
                    "credential",
                    "custom-tool",
                    "skill",
                    "mcp-server",
                    "table",
                    "knowledge-base",
                    "file",
                    "workflow",
                    "deployment"
                  ],
                  "description": "A resource kind: `secret`, `credential`, `custom-tool`, `skill`, `mcp-server`, `table`, `knowledge-base`, `file`, `workflow`, `deployment`."
                }
              }
            },
            "additionalProperties": false
          },
          "provenance": {
            "description": "Where the directory came from, for the audit log.",
            "type": "object",
            "properties": {
              "client": {
                "type": "string",
                "enum": [
                  "cli",
                  "api"
                ],
                "description": "What submitted the directory."
              },
              "gitSha": {
                "description": "The commit the directory was taken from; recorded in the audit log.",
                "type": "string",
                "pattern": "^[0-9a-f]{7,64}$"
              },
              "repo": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512,
                "description": "The repository the source was taken from (its remote URL); recorded in the audit log."
              }
            },
            "required": [
              "client"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "files",
          "kinds"
        ],
        "additionalProperties": false,
        "title": "Apply workspace source body",
        "description": "The directory files, its managed kinds and the base they were read with.",
        "examples": [
          {
            "files": {
              "tables/leads.ts": "// @sim-sdk 1\nimport { column, defineTable } from '@sim/workflow-sdk/workspace'\n\nexport default defineTable({\n  name: 'leads',\n  columns: {\n    email: column.string({ required: true, unique: true }),\n    status: column.select({ options: ['new', 'won'] }),\n  },\n})\n"
            },
            "kinds": [
              "table"
            ],
            "base": {
              "version": 1,
              "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64",
              "resources": {
                "table:leads": {
                  "id": "tbl_5c0e2a7b9d1f4e3a8b6c2d0f7e9a1b3c",
                  "fingerprint": "rf1:4b8d2f6a0c3e7b1d5f9a2c6e0b4d8f3a7c1e5b9d2f6a0c4e8b3d7f1a5c9e2b6d",
                  "columns": {
                    "email": {
                      "id": "col_8e1c4a7b2d5f"
                    },
                    "status": {
                      "id": "col_3b6d9f2a5c8e",
                      "options": {
                        "new": "k2Pq9x",
                        "won": "r7Tn4m"
                      }
                    }
                  }
                }
              }
            }
          }
        ]
      },
      "examples": {
        "example1": {
          "summary": "Request example 1",
          "value": {
            "files": {
              "tables/leads.ts": "// @sim-sdk 1\nimport { column, defineTable } from '@sim/workflow-sdk/workspace'\n\nexport default defineTable({\n  name: 'leads',\n  columns: {\n    email: column.string({ required: true, unique: true }),\n    status: column.select({ options: ['new', 'won'] }),\n  },\n})\n"
            },
            "kinds": [
              "table"
            ],
            "base": {
              "version": 1,
              "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64",
              "resources": {
                "table:leads": {
                  "id": "tbl_5c0e2a7b9d1f4e3a8b6c2d0f7e9a1b3c",
                  "fingerprint": "rf1:4b8d2f6a0c3e7b1d5f9a2c6e0b4d8f3a7c1e5b9d2f6a0c4e8b3d7f1a5c9e2b6d",
                  "columns": {
                    "email": {
                      "id": "col_8e1c4a7b2d5f"
                    },
                    "status": {
                      "id": "col_3b6d9f2a5c8e",
                      "options": {
                        "new": "k2Pq9x",
                        "won": "r7Tn4m"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

```

## Responses

### 200

```json

{
  "description": "The applied (or planned) changes.",
  "headers": {
    "X-RateLimit-Limit": {
      "description": "Maximum requests allowed in the current window.",
      "schema": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "title": "Rate limit",
        "description": "Maximum requests allowed in the current window."
      }
    },
    "X-RateLimit-Remaining": {
      "description": "Requests remaining in the current window.",
      "schema": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "title": "Rate limit remaining",
        "description": "Requests remaining in the current window."
      }
    },
    "X-RateLimit-Reset": {
      "description": "ISO 8601 timestamp when the current rate-limit window resets.",
      "schema": {
        "type": "string",
        "format": "date-time",
        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
        "title": "Rate limit reset",
        "description": "ISO 8601 timestamp when the current rate-limit window resets."
      }
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "workspaceId": {
                "type": "string",
                "description": "Workspace id."
              },
              "dryRun": {
                "type": "boolean",
                "description": "True when nothing was written because `dryRun` was set."
              },
              "plan": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "enum": [
                        "secret",
                        "credential",
                        "custom-tool",
                        "skill",
                        "mcp-server",
                        "table",
                        "knowledge-base",
                        "file",
                        "workflow",
                        "deployment"
                      ],
                      "description": "A resource kind: `secret`, `credential`, `custom-tool`, `skill`, `mcp-server`, `table`, `knowledge-base`, `file`, `workflow`, `deployment`."
                    },
                    "key": {
                      "type": "string",
                      "description": "Resource key."
                    },
                    "action": {
                      "type": "string",
                      "enum": [
                        "create",
                        "update",
                        "adopt",
                        "delete",
                        "noop"
                      ],
                      "description": "`adopt` binds the key to an existing resource of the same name, then updates it."
                    },
                    "fields": {
                      "description": "What changes.",
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "destructive": {
                      "description": "Data the change deletes: dropped columns, removed select options and the cells they empty, or a deleted resource. A dry run shows it whether or not `allowDelete` is set.",
                      "type": "object",
                      "properties": {
                        "what": {
                          "type": "string",
                          "description": "What is lost."
                        },
                        "counts": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "description": "How much is lost."
                        }
                      },
                      "required": [
                        "what",
                        "counts"
                      ],
                      "additionalProperties": false
                    },
                    "id": {
                      "description": "Stored id, once known.",
                      "type": "string"
                    },
                    "held": {
                      "description": "Held back: the change uses a declared secret the workspace has no value for, or a declared credential key nothing binds to (see its errors). It is not written; the rest of the apply goes ahead.",
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "required": [
                    "kind",
                    "key",
                    "action"
                  ],
                  "additionalProperties": false,
                  "description": "One planned or applied change."
                },
                "description": "Every planned change, no-ops included, in apply order."
              },
              "refuses": {
                "description": "Set on a dry run: whether the apply would refuse. Errors of a change held back (`held`) refuse nothing else; any other error refuses. Absent on an apply.",
                "type": "boolean"
              },
              "applied": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "enum": [
                        "secret",
                        "credential",
                        "custom-tool",
                        "skill",
                        "mcp-server",
                        "table",
                        "knowledge-base",
                        "file",
                        "workflow",
                        "deployment"
                      ],
                      "description": "A resource kind: `secret`, `credential`, `custom-tool`, `skill`, `mcp-server`, `table`, `knowledge-base`, `file`, `workflow`, `deployment`."
                    },
                    "key": {
                      "type": "string",
                      "description": "Resource key."
                    },
                    "action": {
                      "type": "string",
                      "enum": [
                        "create",
                        "update",
                        "adopt",
                        "delete",
                        "noop"
                      ],
                      "description": "`adopt` binds the key to an existing resource of the same name, then updates it."
                    },
                    "fields": {
                      "description": "What changes.",
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "destructive": {
                      "description": "Data the change deletes: dropped columns, removed select options and the cells they empty, or a deleted resource. A dry run shows it whether or not `allowDelete` is set.",
                      "type": "object",
                      "properties": {
                        "what": {
                          "type": "string",
                          "description": "What is lost."
                        },
                        "counts": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "description": "How much is lost."
                        }
                      },
                      "required": [
                        "what",
                        "counts"
                      ],
                      "additionalProperties": false
                    },
                    "id": {
                      "description": "Stored id, once known.",
                      "type": "string"
                    },
                    "held": {
                      "description": "Held back: the change uses a declared secret the workspace has no value for, or a declared credential key nothing binds to (see its errors). It is not written; the rest of the apply goes ahead.",
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "required": [
                    "kind",
                    "key",
                    "action"
                  ],
                  "additionalProperties": false,
                  "description": "One planned or applied change."
                },
                "description": "The changes written, in order."
              },
              "failed": {
                "description": "The change that failed mid-apply. The changes before it are written (`applied`); the rest were not attempted. Applying the same directory again continues.",
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "secret",
                      "credential",
                      "custom-tool",
                      "skill",
                      "mcp-server",
                      "table",
                      "knowledge-base",
                      "file",
                      "workflow",
                      "deployment"
                    ],
                    "description": "A resource kind: `secret`, `credential`, `custom-tool`, `skill`, `mcp-server`, `table`, `knowledge-base`, `file`, `workflow`, `deployment`."
                  },
                  "key": {
                    "type": "string",
                    "description": "Resource key."
                  },
                  "code": {
                    "type": "string",
                    "enum": [
                      "E_DECL_SYNTAX",
                      "E_DECL_HEADER",
                      "E_DECL_IMPORT",
                      "E_DECL_EXPORT",
                      "E_DECL_UNSUPPORTED",
                      "E_DECL_DUPLICATE_KEY",
                      "E_DECL_SHAPE",
                      "E_DECL_UNKNOWN_FIELD",
                      "E_DECL_UNKNOWN_FILE",
                      "W_PATH_NOT_SENT",
                      "E_BLOB_MANIFEST",
                      "E_BLOB_MISSING",
                      "E_KEY_INVALID",
                      "W_DECL_SUSPICIOUS_CHARACTER",
                      "E_BASE_JSON",
                      "E_BASE_VERSION",
                      "E_BASE_SHAPE",
                      "E_BASE_UNKNOWN_FIELD",
                      "E_SECRET_NAME",
                      "E_SECRET_MISSING",
                      "W_SECRET_MISSING",
                      "E_CREDENTIAL_MISSING",
                      "E_CREDENTIAL_AMBIGUOUS",
                      "W_CREDENTIAL_MISSING",
                      "W_CREDENTIAL_AMBIGUOUS",
                      "E_TABLE_COLUMN_NAME",
                      "E_TABLE_DUPLICATE_COLUMN",
                      "E_TABLE_TOO_MANY_COLUMNS",
                      "E_TABLE_OPTIONS",
                      "E_TABLE_TYPE_CONVERSION",
                      "E_TABLE_FOLDER",
                      "E_TABLE_ROWS",
                      "I_TABLE_SEED_SKIPPED",
                      "I_TABLE_ROWS_UNKEYED",
                      "W_LIKELY_RENAME",
                      "E_TOOL_SCHEMA",
                      "E_TOOL_CODE",
                      "E_TOOL_STORED_MISSING",
                      "W_TOOL_LITERAL_SECRET",
                      "E_SKILL_FRONTMATTER",
                      "E_MCP_LITERAL_SECRET",
                      "E_MCP_STORED_MISSING",
                      "E_MCP_TOOL_UNKNOWN",
                      "W_MCP_REPLACE",
                      "W_MCP_TOOLS_UNCHECKED",
                      "E_FILE_PATH",
                      "E_FILE_PATH_COLLISION",
                      "E_FILE_NAME",
                      "E_FILE_TOO_LARGE",
                      "E_FILE_CONTENT",
                      "E_KB_EMBEDDING_IMMUTABLE",
                      "E_KB_EMBEDDING_MODEL",
                      "E_KB_DOC_AMBIGUOUS",
                      "E_KB_DOC_NAME",
                      "E_KB_DOC_EMPTY",
                      "E_KB_CHUNKING",
                      "E_KB_FOLDER",
                      "W_KB_DOC_UNCHECKED",
                      "W_KB_DOC_FAILED",
                      "I_KB_REEMBED",
                      "I_KB_CHUNKING",
                      "I_KB_PROCESSING",
                      "I_KB_DOCS_UNHASHED",
                      "I_KB_UNMANAGED_DOCS",
                      "I_KB_REPLACE_UNFINISHED",
                      "E_DEPLOY_WORKFLOW",
                      "E_DEPLOY_SECRET",
                      "E_DEPLOY_CHAT_OUTPUT",
                      "E_DEPLOY_CHAT_IDENTIFIER",
                      "E_DEPLOY_PINNED_CHAT",
                      "W_DEPLOYED_DRAFT_CHANGED",
                      "W_DEPLOY_DRAFT_NOT_SOURCE",
                      "E_DEPLOY_DRAFT_NOT_SOURCE_CHAT",
                      "I_DEPLOY_DRAFT_NOT_LIVE",
                      "E_APPLY_NO_BASE",
                      "E_APPLY_FORBIDDEN",
                      "E_APPLY_DELETE_NOT_ALLOWED",
                      "E_APPLY_LOCKED",
                      "E_APPLY_REFUSED",
                      "E_APPLY_FAILED",
                      "E_PLAN_TOO_LARGE",
                      "E_PLAN_REF_DELETED",
                      "E_PLAN_REF_HELD",
                      "W_RESOURCE_IN_USE",
                      "W_TABLE_COLUMN_RENAMED_IN_USE",
                      "E_WORKFLOW_FILES_MISSING",
                      "E_WORKFLOW_FOLDER_COPIED",
                      "W_UNDECLARED",
                      "W_BASE_OTHER_WORKSPACE",
                      "W_PROMOTE_TARGET_DELETED",
                      "W_PROMOTE_DELETES_TARGET_ONLY",
                      "W_SERVER_CHANGED",
                      "W_SERVER_DELETED",
                      "W_SERVER_MOVED",
                      "I_KEY_REBOUND",
                      "E_KEY_RENAMED",
                      "E_APPLY_STALE",
                      "E_LIMIT_EXCEEDED",
                      "E_NAME_TAKEN",
                      "I_FINDINGS_TRUNCATED",
                      "E_SYNTAX",
                      "E_SDK_HEADER",
                      "E_SDK_MAJOR",
                      "E_SDK_MAJOR_OLD",
                      "E_UNSUPPORTED_SYNTAX",
                      "E_WORKFLOW_EXPORT",
                      "E_INVALID_CHARACTER",
                      "E_NUMBER_NOT_FINITE",
                      "W_NUMBER_PRECISION",
                      "E_TOO_MANY_ERRORS",
                      "E_DUPLICATE_NAME",
                      "E_RESERVED_NAME",
                      "E_KEY_OVERRIDE",
                      "E_EMPTY_NAME",
                      "E_LOOKALIKE_NAME",
                      "W_LOOKALIKE_NAME",
                      "W_SUSPICIOUS_CHARACTER",
                      "E_NAME_NOT_LITERAL",
                      "E_UNKNOWN_IDENTIFIER",
                      "E_OUT_OF_SCOPE",
                      "E_UNKNOWN_VARIABLE",
                      "E_DUPLICATE_VARIABLE",
                      "E_VARIABLE_NAME_MISMATCH",
                      "E_INVALID_ENV_NAME",
                      "W_ENV_UNKNOWN",
                      "W_CHILD_INPUT_UNKNOWN",
                      "W_CHILD_NO_START",
                      "W_CHILD_RESULT_PATH",
                      "E_UNKNOWN_SUBFLOW_PROPERTY",
                      "W_FORWARD_REF",
                      "W_REF_NOT_NORMALIZED",
                      "E_REF_UNREPRESENTABLE",
                      "W_REF_OUT_OF_SCOPE",
                      "E_EDGE_SCOPE",
                      "E_EDGE_NOTE",
                      "E_TARGET_TRIGGER",
                      "E_NO_DEFAULT_OUTPUT",
                      "E_DUPLICATE_EDGE",
                      "E_ERROR_PORT_UNSUPPORTED",
                      "W_ERROR_PORT_STORED",
                      "E_UNKNOWN_BRANCH",
                      "E_DUPLICATE_BRANCH_KEY",
                      "E_BRANCH_KEY_COLLIDES",
                      "E_BRANCH_ELSE_LAST",
                      "W_RAW_HANDLE",
                      "W_SUBFLOW_HANDLE_SCOPE",
                      "E_EDGE_CYCLE",
                      "W_EDGE_CYCLE",
                      "W_BRANCH_UNWIRED",
                      "E_UNKNOWN_BUILDER",
                      "E_UNKNOWN_PARAM",
                      "E_FIXED_PARAM",
                      "W_FIELD_NOT_APPLICABLE",
                      "W_REQUIRED_MISSING",
                      "W_UNKNOWN_OPTION",
                      "E_UNKNOWN_OPERATION",
                      "W_UNKNOWN_MODEL",
                      "W_LEGACY_BLOCK_TYPE",
                      "W_UNKNOWN_BLOCK_TYPE",
                      "W_TYPE_NOT_ADDABLE",
                      "I_SCHEDULE_UTC",
                      "E_STORED_VALUE_MISSING",
                      "W_VALUE_KIND",
                      "W_OUT_OF_RANGE",
                      "W_TABLE_FILTER_SHAPE",
                      "W_LITERAL_SECRET",
                      "W_SUBFLOW_COUNT",
                      "W_UNKNOWN_OUTPUT_PATH",
                      "W_OUTPUT_PATH_UNDECLARED",
                      "W_JSON_REF_UNTYPED",
                      "W_LOOP_CONDITION_SYNTAX",
                      "E_CODE_FILE_MISSING",
                      "E_CODE_FILE_PATH",
                      "W_CODE_FILE_INLINED",
                      "W_CODE_FILE_REF_SYNTAX",
                      "W_UNRESOLVED_REF",
                      "W_FORWARD_REF_LITERALIZED",
                      "W_COMMENT_MOVED",
                      "W_COMMENT_DROPPED",
                      "E_LOCK_JSON",
                      "E_LOCK_VERSION",
                      "E_LOCK_SHAPE",
                      "E_LOCK_UNKNOWN_FIELD",
                      "E_LOCK_KEY",
                      "E_LOCK_IDENT",
                      "E_LOCK_DUPLICATE_IDENT",
                      "E_LOCK_DUPLICATE_ID",
                      "E_LOCK_PARENT",
                      "E_LOCK_BRANCH",
                      "E_LOCK_CODE_FILE_PATH",
                      "E_SOURCE_META_JSON",
                      "E_SOURCE_META_VERSION",
                      "E_SOURCE_META_SHAPE",
                      "E_SOURCE_META_UNKNOWN_FIELD",
                      "E_SOURCE_META_IDENT",
                      "E_SOURCE_META_DUPLICATE_IDENT",
                      "E_SOURCE_META_ANCHOR",
                      "E_CANON_LEGACY_NAME_COLLISION",
                      "E_CANON_EDGE_SCOPE",
                      "W_CANON_RESERVED_NAME",
                      "W_CANON_DANGLING_EDGE",
                      "W_CANON_DANGLING_PARENT",
                      "W_CANON_RAW_HANDLE",
                      "W_CANON_UNKNOWN_BLOCK_TYPE",
                      "W_CANON_UNRESOLVED_ID",
                      "W_CANON_TITLE_OVERRIDE",
                      "W_CANON_SUBFLOW_REPAIRED",
                      "W_CANON_SUBBLOCK_TYPE_DRIFT",
                      "W_CANON_UNDECODABLE_JSON",
                      "E_MAT_DUPLICATE_LOCK_ID",
                      "E_MAT_UNKNOWN_RESOURCE",
                      "E_MAT_UNKNOWN_VARIABLE",
                      "W_MAT_DELETED_SINCE_PULL",
                      "W_MAT_INFERRED_RENAME",
                      "W_MAT_RETYPE_RECREATED",
                      "W_MAT_LOCK_ID_CLAIMED",
                      "I_MAT_NEEDS_LAYOUT",
                      "E_APPLY_WORKFLOW_MISMATCH",
                      "E_APPLY_LOCKED_BLOCK",
                      "E_APPLY_TYPE_NOT_ADDABLE",
                      "E_APPLY_INVALID_STATE",
                      "E_APPLY_BLOCK_NOT_FOUND",
                      "E_APPLY_INVALID_BLOCK_TYPE",
                      "E_APPLY_BLOCK_NOT_ALLOWED",
                      "E_APPLY_MODEL_NOT_ALLOWED",
                      "E_APPLY_TOOL_NOT_ALLOWED",
                      "E_APPLY_INVALID_EDGE_SOURCE",
                      "E_APPLY_INVALID_EDGE_SCOPE",
                      "E_APPLY_INVALID_SOURCE_HANDLE",
                      "E_APPLY_INVALID_TARGET_HANDLE",
                      "E_APPLY_INVALID_SUBBLOCK_FIELD",
                      "E_APPLY_MISSING_REQUIRED_PARAMS",
                      "E_APPLY_RETRY_NOT_SUPPORTED",
                      "E_APPLY_DUPLICATE_TRIGGER",
                      "E_APPLY_DUPLICATE_SINGLE_INSTANCE_BLOCK",
                      "E_APPLY_DISABLED_ANCESTOR",
                      "E_APPLY_CREDENTIAL_UNREACHABLE",
                      "W_APPLY_CREDENTIAL_KEPT",
                      "E_APPLY_SANDBOX_PLAN_REQUIRED",
                      "W_APPLY_HOSTED_KEY_DROPPED",
                      "W_APPLY_VALUE_NORMALIZED",
                      "W_APPLY_TYPE_CHANGED",
                      "W_APPLY_TRIGGER_REMOVED",
                      "W_APPLY_CATALOG_MOVED",
                      "W_APPLY_PROBABLE_RENAME",
                      "E_APPLY_LINT",
                      "E_APPLY_UNRESOLVED_REF",
                      "E_APPLY_REF_OUT_OF_SCOPE",
                      "E_APPLY_CODE_FILE_REF_SYNTAX",
                      "E_APPLY_LOOP_CONDITION_SYNTAX",
                      "W_APPLY_LINT",
                      "W_TABLE_UNKNOWN_COLUMN",
                      "E_APPLY_INVALID_SCHEDULE",
                      "E_APPLY_BLOCK_DELETE",
                      "E_APPLY_VARIABLE_DELETE",
                      "E_WORKFLOW_META_INVALID"
                    ],
                    "description": "Diagnostic code."
                  },
                  "message": {
                    "type": "string",
                    "description": "What failed."
                  }
                },
                "required": [
                  "kind",
                  "key",
                  "code",
                  "message"
                ],
                "additionalProperties": false
              },
              "needBlobs": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Binary paths a write needs whose bytes are not staged: on a dry run, exactly what to stage before applying."
              },
              "applyId": {
                "description": "The id of an apply that wrote: every audit log entry its writes recorded carries it as `metadata.correlationId`. Absent on a dry run.",
                "type": "string"
              },
              "files": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "string"
                },
                "description": "Files re-printed from what was saved, for every resource written."
              },
              "base": {
                "type": "object",
                "properties": {
                  "version": {
                    "type": "number",
                    "const": 1,
                    "description": "Base format version."
                  },
                  "workspaceId": {
                    "type": "string",
                    "description": "Workspace the directory was read from."
                  },
                  "resources": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Stored id the key is bound to."
                        },
                        "fingerprint": {
                          "description": "`rf1:` fingerprint of the resource as last read; absent for a workflow, and for a binary file listed without `sha256` until the client records its hash.",
                          "type": "string"
                        },
                        "columns": {
                          "description": "Table column key → stored column.",
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "description": "Stored column id."
                              },
                              "options": {
                                "description": "Select option name → option id.",
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "id"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "blobs": {
                          "description": "Binary file name → its stored id, revision and hash as last read.",
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "description": "Stored id of the binary file."
                              },
                              "rev": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "string"
                                  }
                                ],
                                "description": "Content revision as last read."
                              },
                              "sha256": {
                                "type": "string",
                                "pattern": "^[0-9a-f]{64}$",
                                "description": "SHA-256 of the bytes, lowercase hex."
                              }
                            },
                            "required": [
                              "id",
                              "rev",
                              "sha256"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "rows": {
                          "description": "A table’s managed rows, as last read.",
                          "type": "object",
                          "properties": {
                            "fingerprint": {
                              "type": "string",
                              "description": "`rf1:` fingerprint of the managed rows as last read."
                            },
                            "version": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991,
                              "description": "The table’s row version as last read; it moves on every row write."
                            }
                          },
                          "required": [
                            "fingerprint",
                            "version"
                          ],
                          "additionalProperties": {
                            "description": "An `x-` extension field, kept as written."
                          }
                        }
                      },
                      "required": [
                        "id"
                      ],
                      "additionalProperties": {
                        "description": "An `x-` extension field, kept as written."
                      },
                      "description": "One resource in the base."
                    },
                    "description": "`kind:key` → the stored resource and its fingerprint."
                  }
                },
                "required": [
                  "version",
                  "workspaceId",
                  "resources"
                ],
                "additionalProperties": {
                  "description": "An `x-` extension field, kept as written."
                },
                "description": "The base after this apply: the next apply’s `base`."
              },
              "diagnostics": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "E_DECL_SYNTAX",
                        "E_DECL_HEADER",
                        "E_DECL_IMPORT",
                        "E_DECL_EXPORT",
                        "E_DECL_UNSUPPORTED",
                        "E_DECL_DUPLICATE_KEY",
                        "E_DECL_SHAPE",
                        "E_DECL_UNKNOWN_FIELD",
                        "E_DECL_UNKNOWN_FILE",
                        "W_PATH_NOT_SENT",
                        "E_BLOB_MANIFEST",
                        "E_BLOB_MISSING",
                        "E_KEY_INVALID",
                        "W_DECL_SUSPICIOUS_CHARACTER",
                        "E_BASE_JSON",
                        "E_BASE_VERSION",
                        "E_BASE_SHAPE",
                        "E_BASE_UNKNOWN_FIELD",
                        "E_SECRET_NAME",
                        "E_SECRET_MISSING",
                        "W_SECRET_MISSING",
                        "E_CREDENTIAL_MISSING",
                        "E_CREDENTIAL_AMBIGUOUS",
                        "W_CREDENTIAL_MISSING",
                        "W_CREDENTIAL_AMBIGUOUS",
                        "E_TABLE_COLUMN_NAME",
                        "E_TABLE_DUPLICATE_COLUMN",
                        "E_TABLE_TOO_MANY_COLUMNS",
                        "E_TABLE_OPTIONS",
                        "E_TABLE_TYPE_CONVERSION",
                        "E_TABLE_FOLDER",
                        "E_TABLE_ROWS",
                        "I_TABLE_SEED_SKIPPED",
                        "I_TABLE_ROWS_UNKEYED",
                        "W_LIKELY_RENAME",
                        "E_TOOL_SCHEMA",
                        "E_TOOL_CODE",
                        "E_TOOL_STORED_MISSING",
                        "W_TOOL_LITERAL_SECRET",
                        "E_SKILL_FRONTMATTER",
                        "E_MCP_LITERAL_SECRET",
                        "E_MCP_STORED_MISSING",
                        "E_MCP_TOOL_UNKNOWN",
                        "W_MCP_REPLACE",
                        "W_MCP_TOOLS_UNCHECKED",
                        "E_FILE_PATH",
                        "E_FILE_PATH_COLLISION",
                        "E_FILE_NAME",
                        "E_FILE_TOO_LARGE",
                        "E_FILE_CONTENT",
                        "E_KB_EMBEDDING_IMMUTABLE",
                        "E_KB_EMBEDDING_MODEL",
                        "E_KB_DOC_AMBIGUOUS",
                        "E_KB_DOC_NAME",
                        "E_KB_DOC_EMPTY",
                        "E_KB_CHUNKING",
                        "E_KB_FOLDER",
                        "W_KB_DOC_UNCHECKED",
                        "W_KB_DOC_FAILED",
                        "I_KB_REEMBED",
                        "I_KB_CHUNKING",
                        "I_KB_PROCESSING",
                        "I_KB_DOCS_UNHASHED",
                        "I_KB_UNMANAGED_DOCS",
                        "I_KB_REPLACE_UNFINISHED",
                        "E_DEPLOY_WORKFLOW",
                        "E_DEPLOY_SECRET",
                        "E_DEPLOY_CHAT_OUTPUT",
                        "E_DEPLOY_CHAT_IDENTIFIER",
                        "E_DEPLOY_PINNED_CHAT",
                        "W_DEPLOYED_DRAFT_CHANGED",
                        "W_DEPLOY_DRAFT_NOT_SOURCE",
                        "E_DEPLOY_DRAFT_NOT_SOURCE_CHAT",
                        "I_DEPLOY_DRAFT_NOT_LIVE",
                        "E_APPLY_NO_BASE",
                        "E_APPLY_FORBIDDEN",
                        "E_APPLY_DELETE_NOT_ALLOWED",
                        "E_APPLY_LOCKED",
                        "E_APPLY_REFUSED",
                        "E_APPLY_FAILED",
                        "E_PLAN_TOO_LARGE",
                        "E_PLAN_REF_DELETED",
                        "E_PLAN_REF_HELD",
                        "W_RESOURCE_IN_USE",
                        "W_TABLE_COLUMN_RENAMED_IN_USE",
                        "E_WORKFLOW_FILES_MISSING",
                        "E_WORKFLOW_FOLDER_COPIED",
                        "W_UNDECLARED",
                        "W_BASE_OTHER_WORKSPACE",
                        "W_PROMOTE_TARGET_DELETED",
                        "W_PROMOTE_DELETES_TARGET_ONLY",
                        "W_SERVER_CHANGED",
                        "W_SERVER_DELETED",
                        "W_SERVER_MOVED",
                        "I_KEY_REBOUND",
                        "E_KEY_RENAMED",
                        "E_APPLY_STALE",
                        "E_LIMIT_EXCEEDED",
                        "E_NAME_TAKEN",
                        "I_FINDINGS_TRUNCATED",
                        "E_SYNTAX",
                        "E_SDK_HEADER",
                        "E_SDK_MAJOR",
                        "E_SDK_MAJOR_OLD",
                        "E_UNSUPPORTED_SYNTAX",
                        "E_WORKFLOW_EXPORT",
                        "E_INVALID_CHARACTER",
                        "E_NUMBER_NOT_FINITE",
                        "W_NUMBER_PRECISION",
                        "E_TOO_MANY_ERRORS",
                        "E_DUPLICATE_NAME",
                        "E_RESERVED_NAME",
                        "E_KEY_OVERRIDE",
                        "E_EMPTY_NAME",
                        "E_LOOKALIKE_NAME",
                        "W_LOOKALIKE_NAME",
                        "W_SUSPICIOUS_CHARACTER",
                        "E_NAME_NOT_LITERAL",
                        "E_UNKNOWN_IDENTIFIER",
                        "E_OUT_OF_SCOPE",
                        "E_UNKNOWN_VARIABLE",
                        "E_DUPLICATE_VARIABLE",
                        "E_VARIABLE_NAME_MISMATCH",
                        "E_INVALID_ENV_NAME",
                        "W_ENV_UNKNOWN",
                        "W_CHILD_INPUT_UNKNOWN",
                        "W_CHILD_NO_START",
                        "W_CHILD_RESULT_PATH",
                        "E_UNKNOWN_SUBFLOW_PROPERTY",
                        "W_FORWARD_REF",
                        "W_REF_NOT_NORMALIZED",
                        "E_REF_UNREPRESENTABLE",
                        "W_REF_OUT_OF_SCOPE",
                        "E_EDGE_SCOPE",
                        "E_EDGE_NOTE",
                        "E_TARGET_TRIGGER",
                        "E_NO_DEFAULT_OUTPUT",
                        "E_DUPLICATE_EDGE",
                        "E_ERROR_PORT_UNSUPPORTED",
                        "W_ERROR_PORT_STORED",
                        "E_UNKNOWN_BRANCH",
                        "E_DUPLICATE_BRANCH_KEY",
                        "E_BRANCH_KEY_COLLIDES",
                        "E_BRANCH_ELSE_LAST",
                        "W_RAW_HANDLE",
                        "W_SUBFLOW_HANDLE_SCOPE",
                        "E_EDGE_CYCLE",
                        "W_EDGE_CYCLE",
                        "W_BRANCH_UNWIRED",
                        "E_UNKNOWN_BUILDER",
                        "E_UNKNOWN_PARAM",
                        "E_FIXED_PARAM",
                        "W_FIELD_NOT_APPLICABLE",
                        "W_REQUIRED_MISSING",
                        "W_UNKNOWN_OPTION",
                        "E_UNKNOWN_OPERATION",
                        "W_UNKNOWN_MODEL",
                        "W_LEGACY_BLOCK_TYPE",
                        "W_UNKNOWN_BLOCK_TYPE",
                        "W_TYPE_NOT_ADDABLE",
                        "I_SCHEDULE_UTC",
                        "E_STORED_VALUE_MISSING",
                        "W_VALUE_KIND",
                        "W_OUT_OF_RANGE",
                        "W_TABLE_FILTER_SHAPE",
                        "W_LITERAL_SECRET",
                        "W_SUBFLOW_COUNT",
                        "W_UNKNOWN_OUTPUT_PATH",
                        "W_OUTPUT_PATH_UNDECLARED",
                        "W_JSON_REF_UNTYPED",
                        "W_LOOP_CONDITION_SYNTAX",
                        "E_CODE_FILE_MISSING",
                        "E_CODE_FILE_PATH",
                        "W_CODE_FILE_INLINED",
                        "W_CODE_FILE_REF_SYNTAX",
                        "W_UNRESOLVED_REF",
                        "W_FORWARD_REF_LITERALIZED",
                        "W_COMMENT_MOVED",
                        "W_COMMENT_DROPPED",
                        "E_LOCK_JSON",
                        "E_LOCK_VERSION",
                        "E_LOCK_SHAPE",
                        "E_LOCK_UNKNOWN_FIELD",
                        "E_LOCK_KEY",
                        "E_LOCK_IDENT",
                        "E_LOCK_DUPLICATE_IDENT",
                        "E_LOCK_DUPLICATE_ID",
                        "E_LOCK_PARENT",
                        "E_LOCK_BRANCH",
                        "E_LOCK_CODE_FILE_PATH",
                        "E_SOURCE_META_JSON",
                        "E_SOURCE_META_VERSION",
                        "E_SOURCE_META_SHAPE",
                        "E_SOURCE_META_UNKNOWN_FIELD",
                        "E_SOURCE_META_IDENT",
                        "E_SOURCE_META_DUPLICATE_IDENT",
                        "E_SOURCE_META_ANCHOR",
                        "E_CANON_LEGACY_NAME_COLLISION",
                        "E_CANON_EDGE_SCOPE",
                        "W_CANON_RESERVED_NAME",
                        "W_CANON_DANGLING_EDGE",
                        "W_CANON_DANGLING_PARENT",
                        "W_CANON_RAW_HANDLE",
                        "W_CANON_UNKNOWN_BLOCK_TYPE",
                        "W_CANON_UNRESOLVED_ID",
                        "W_CANON_TITLE_OVERRIDE",
                        "W_CANON_SUBFLOW_REPAIRED",
                        "W_CANON_SUBBLOCK_TYPE_DRIFT",
                        "W_CANON_UNDECODABLE_JSON",
                        "E_MAT_DUPLICATE_LOCK_ID",
                        "E_MAT_UNKNOWN_RESOURCE",
                        "E_MAT_UNKNOWN_VARIABLE",
                        "W_MAT_DELETED_SINCE_PULL",
                        "W_MAT_INFERRED_RENAME",
                        "W_MAT_RETYPE_RECREATED",
                        "W_MAT_LOCK_ID_CLAIMED",
                        "I_MAT_NEEDS_LAYOUT",
                        "E_APPLY_WORKFLOW_MISMATCH",
                        "E_APPLY_LOCKED_BLOCK",
                        "E_APPLY_TYPE_NOT_ADDABLE",
                        "E_APPLY_INVALID_STATE",
                        "E_APPLY_BLOCK_NOT_FOUND",
                        "E_APPLY_INVALID_BLOCK_TYPE",
                        "E_APPLY_BLOCK_NOT_ALLOWED",
                        "E_APPLY_MODEL_NOT_ALLOWED",
                        "E_APPLY_TOOL_NOT_ALLOWED",
                        "E_APPLY_INVALID_EDGE_SOURCE",
                        "E_APPLY_INVALID_EDGE_SCOPE",
                        "E_APPLY_INVALID_SOURCE_HANDLE",
                        "E_APPLY_INVALID_TARGET_HANDLE",
                        "E_APPLY_INVALID_SUBBLOCK_FIELD",
                        "E_APPLY_MISSING_REQUIRED_PARAMS",
                        "E_APPLY_RETRY_NOT_SUPPORTED",
                        "E_APPLY_DUPLICATE_TRIGGER",
                        "E_APPLY_DUPLICATE_SINGLE_INSTANCE_BLOCK",
                        "E_APPLY_DISABLED_ANCESTOR",
                        "E_APPLY_CREDENTIAL_UNREACHABLE",
                        "W_APPLY_CREDENTIAL_KEPT",
                        "E_APPLY_SANDBOX_PLAN_REQUIRED",
                        "W_APPLY_HOSTED_KEY_DROPPED",
                        "W_APPLY_VALUE_NORMALIZED",
                        "W_APPLY_TYPE_CHANGED",
                        "W_APPLY_TRIGGER_REMOVED",
                        "W_APPLY_CATALOG_MOVED",
                        "W_APPLY_PROBABLE_RENAME",
                        "E_APPLY_LINT",
                        "E_APPLY_UNRESOLVED_REF",
                        "E_APPLY_REF_OUT_OF_SCOPE",
                        "E_APPLY_CODE_FILE_REF_SYNTAX",
                        "E_APPLY_LOOP_CONDITION_SYNTAX",
                        "W_APPLY_LINT",
                        "W_TABLE_UNKNOWN_COLUMN",
                        "E_APPLY_INVALID_SCHEDULE",
                        "E_APPLY_BLOCK_DELETE",
                        "E_APPLY_VARIABLE_DELETE",
                        "E_WORKFLOW_META_INVALID"
                      ],
                      "description": "Diagnostic code, e.g. `E_APPLY_STALE` or `E_UNKNOWN_PARAM`."
                    },
                    "severity": {
                      "type": "string",
                      "enum": [
                        "error",
                        "warning",
                        "info"
                      ],
                      "description": "Diagnostic severity."
                    },
                    "message": {
                      "type": "string",
                      "description": "What was found."
                    },
                    "hint": {
                      "description": "How to address it.",
                      "type": "string"
                    },
                    "file": {
                      "description": "Directory file the finding is in.",
                      "type": "string"
                    },
                    "line": {
                      "description": "1-based line in `file`.",
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "column": {
                      "description": "1-based column in `file`.",
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "endLine": {
                      "description": "1-based line the finding ends on.",
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "endColumn": {
                      "description": "1-based column the finding ends at.",
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "frame": {
                      "description": "The source lines around the finding, with a caret row.",
                      "type": "string"
                    },
                    "path": {
                      "description": "JSON Pointer into a JSON file, such as the base.",
                      "type": "string"
                    },
                    "kind": {
                      "description": "Kind of the resource the finding is about.",
                      "type": "string"
                    },
                    "key": {
                      "description": "Key of the resource the finding is about.",
                      "type": "string"
                    },
                    "blockKey": {
                      "description": "Workflow block the finding is about.",
                      "type": "string"
                    },
                    "param": {
                      "description": "Block field the finding is about.",
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "severity",
                    "message"
                  ],
                  "additionalProperties": false,
                  "description": "A finding about the directory, pinned to its file when it has one."
                },
                "description": "Warnings, and on a dry run every error."
              }
            },
            "required": [
              "workspaceId",
              "dryRun",
              "plan",
              "applied",
              "needBlobs",
              "files",
              "base",
              "diagnostics"
            ],
            "additionalProperties": false,
            "description": "Response data."
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false,
        "title": "Apply workspace source response",
        "description": "The plan, what was written, and the files re-printed from it.",
        "examples": [
          {
            "data": {
              "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64",
              "dryRun": false,
              "plan": [
                {
                  "kind": "table",
                  "key": "leads",
                  "action": "noop",
                  "id": "tbl_5c0e2a7b9d1f4e3a8b6c2d0f7e9a1b3c"
                }
              ],
              "applied": [],
              "needBlobs": [],
              "files": {},
              "base": {
                "version": 1,
                "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64",
                "resources": {
                  "table:leads": {
                    "id": "tbl_5c0e2a7b9d1f4e3a8b6c2d0f7e9a1b3c",
                    "fingerprint": "rf1:4b8d2f6a0c3e7b1d5f9a2c6e0b4d8f3a7c1e5b9d2f6a0c4e8b3d7f1a5c9e2b6d",
                    "columns": {
                      "email": {
                        "id": "col_8e1c4a7b2d5f"
                      },
                      "status": {
                        "id": "col_3b6d9f2a5c8e",
                        "options": {
                          "new": "k2Pq9x",
                          "won": "r7Tn4m"
                        }
                      }
                    }
                  }
                }
              },
              "diagnostics": []
            }
          }
        ]
      },
      "examples": {
        "example1": {
          "summary": "Response example 1",
          "value": {
            "data": {
              "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64",
              "dryRun": false,
              "plan": [
                {
                  "kind": "table",
                  "key": "leads",
                  "action": "noop",
                  "id": "tbl_5c0e2a7b9d1f4e3a8b6c2d0f7e9a1b3c"
                }
              ],
              "applied": [],
              "needBlobs": [],
              "files": {},
              "base": {
                "version": 1,
                "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64",
                "resources": {
                  "table:leads": {
                    "id": "tbl_5c0e2a7b9d1f4e3a8b6c2d0f7e9a1b3c",
                    "fingerprint": "rf1:4b8d2f6a0c3e7b1d5f9a2c6e0b4d8f3a7c1e5b9d2f6a0c4e8b3d7f1a5c9e2b6d",
                    "columns": {
                      "email": {
                        "id": "col_8e1c4a7b2d5f"
                      },
                      "status": {
                        "id": "col_3b6d9f2a5c8e",
                        "options": {
                          "new": "k2Pq9x",
                          "won": "r7Tn4m"
                        }
                      }
                    }
                  }
                }
              },
              "diagnostics": []
            }
          }
        }
      }
    }
  }
}

```

### 400

```json

{
  "description": "The request is invalid. This includes a query parameter sent with no value (`?limit=`, `?search=`), which is rejected rather than read as zero, empty, or the parameter default — omit the parameter instead.",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable machine-readable error code."
              },
              "message": {
                "type": "string",
                "description": "Human-readable explanation of the error."
              },
              "details": {
                "description": "Structured error context whose keys depend on the error. Actionable `403` responses use the `V2ActionableForbiddenDetails` shape; validation failures may return issue arrays instead.",
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string",
                        "enum": [
                          "INSUFFICIENT_WORKSPACE_ROLE",
                          "PERSONAL_API_KEYS_DISABLED",
                          "WORKSPACE_KEY_OPERATION_NOT_PERMITTED",
                          "PRINCIPAL_KIND_NOT_PERMITTED",
                          "ORGANIZATION_MEMBERSHIP_REQUIRED",
                          "ORGANIZATION_ADMIN_REQUIRED",
                          "ENTERPRISE_PLAN_REQUIRED",
                          "SSO_DISABLED",
                          "SSO_DOMAIN_NOT_VERIFIED",
                          "SSO_PROVIDER_LIMIT_REACHED",
                          "ORGANIZATION_PLAN_REQUIRED",
                          "AUDIT_LOGS_DISABLED",
                          "ACCESS_REQUESTS_DISABLED",
                          "ACCESS_REQUEST_ORGANIZATION_REQUIRED",
                          "SKILL_EDITOR_ACCESS_REQUIRED",
                          "SECRET_ADMIN_ACCESS_REQUIRED",
                          "WORKSPACE_RESOURCE_LIMIT_REACHED",
                          "PUBLIC_SHARING_NOT_ALLOWED",
                          "CREDENTIAL_ADMIN_ACCESS_REQUIRED",
                          "MCP_SERVER_URL_NOT_ALLOWED",
                          "WORKSPACE_PLAN_CAPABILITY_REQUIRED",
                          "CHAT_AUTH_MODE_NOT_PERMITTED",
                          "CONNECTOR_MANAGED_RESOURCE_READ_ONLY",
                          "PERMISSION_GROUP_CAPABILITY_BLOCKED",
                          "INTEGRATION_NOT_ALLOWED",
                          "INSUFFICIENT_SCOPE",
                          "READ_ONLY_API_KEY",
                          "SCIM_MANAGED_MEMBERSHIP",
                          "FEATURE_NOT_ENABLED"
                        ],
                        "title": "Forbidden detail code",
                        "description": "Stable cause code for an actionable `403` response."
                      }
                    },
                    "required": [
                      "code"
                    ],
                    "additionalProperties": {
                      "description": "Additional context for this refusal."
                    },
                    "title": "Actionable forbidden details",
                    "description": "Machine-readable cause and optional context for an actionable `403` response."
                  },
                  {
                    "description": "Other structured context defined by the specific error."
                  }
                ]
              },
              "requestId": {
                "description": "Identifier of this request, the same id as the `x-request-id` response header. Quote it when contacting support.",
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false,
            "description": "Canonical error details."
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false,
        "title": "v2 error response",
        "description": "Canonical error envelope returned by the public v2 API.",
        "examples": [
          {
            "error": {
              "code": "BAD_REQUEST",
              "message": "The request is invalid."
            }
          }
        ]
      },
      "example": {
        "error": {
          "code": "BAD_REQUEST",
          "message": "Invalid request"
        }
      }
    }
  }
}

```

### 401

```json

{
  "description": "The API credential is missing or invalid.",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable machine-readable error code."
              },
              "message": {
                "type": "string",
                "description": "Human-readable explanation of the error."
              },
              "details": {
                "description": "Structured error context whose keys depend on the error. Actionable `403` responses use the `V2ActionableForbiddenDetails` shape; validation failures may return issue arrays instead.",
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string",
                        "enum": [
                          "INSUFFICIENT_WORKSPACE_ROLE",
                          "PERSONAL_API_KEYS_DISABLED",
                          "WORKSPACE_KEY_OPERATION_NOT_PERMITTED",
                          "PRINCIPAL_KIND_NOT_PERMITTED",
                          "ORGANIZATION_MEMBERSHIP_REQUIRED",
                          "ORGANIZATION_ADMIN_REQUIRED",
                          "ENTERPRISE_PLAN_REQUIRED",
                          "SSO_DISABLED",
                          "SSO_DOMAIN_NOT_VERIFIED",
                          "SSO_PROVIDER_LIMIT_REACHED",
                          "ORGANIZATION_PLAN_REQUIRED",
                          "AUDIT_LOGS_DISABLED",
                          "ACCESS_REQUESTS_DISABLED",
                          "ACCESS_REQUEST_ORGANIZATION_REQUIRED",
                          "SKILL_EDITOR_ACCESS_REQUIRED",
                          "SECRET_ADMIN_ACCESS_REQUIRED",
                          "WORKSPACE_RESOURCE_LIMIT_REACHED",
                          "PUBLIC_SHARING_NOT_ALLOWED",
                          "CREDENTIAL_ADMIN_ACCESS_REQUIRED",
                          "MCP_SERVER_URL_NOT_ALLOWED",
                          "WORKSPACE_PLAN_CAPABILITY_REQUIRED",
                          "CHAT_AUTH_MODE_NOT_PERMITTED",
                          "CONNECTOR_MANAGED_RESOURCE_READ_ONLY",
                          "PERMISSION_GROUP_CAPABILITY_BLOCKED",
                          "INTEGRATION_NOT_ALLOWED",
                          "INSUFFICIENT_SCOPE",
                          "READ_ONLY_API_KEY",
                          "SCIM_MANAGED_MEMBERSHIP",
                          "FEATURE_NOT_ENABLED"
                        ],
                        "title": "Forbidden detail code",
                        "description": "Stable cause code for an actionable `403` response."
                      }
                    },
                    "required": [
                      "code"
                    ],
                    "additionalProperties": {
                      "description": "Additional context for this refusal."
                    },
                    "title": "Actionable forbidden details",
                    "description": "Machine-readable cause and optional context for an actionable `403` response."
                  },
                  {
                    "description": "Other structured context defined by the specific error."
                  }
                ]
              },
              "requestId": {
                "description": "Identifier of this request, the same id as the `x-request-id` response header. Quote it when contacting support.",
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false,
            "description": "Canonical error details."
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false,
        "title": "v2 error response",
        "description": "Canonical error envelope returned by the public v2 API.",
        "examples": [
          {
            "error": {
              "code": "BAD_REQUEST",
              "message": "The request is invalid."
            }
          }
        ]
      },
      "example": {
        "error": {
          "code": "UNAUTHORIZED",
          "message": "Authentication required"
        }
      }
    }
  }
}

```

### 403

```json

{
  "description": "The caller lacks the rights this operation requires. When the cause is one a caller can act on, `error.details.code` names it. A resource in a workspace the caller cannot reach at all answers `404` instead, so absence and denial are indistinguishable.",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable machine-readable error code."
              },
              "message": {
                "type": "string",
                "description": "Human-readable explanation of the error."
              },
              "details": {
                "description": "Structured error context whose keys depend on the error. Actionable `403` responses use the `V2ActionableForbiddenDetails` shape; validation failures may return issue arrays instead.",
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string",
                        "enum": [
                          "INSUFFICIENT_WORKSPACE_ROLE",
                          "PERSONAL_API_KEYS_DISABLED",
                          "WORKSPACE_KEY_OPERATION_NOT_PERMITTED",
                          "PRINCIPAL_KIND_NOT_PERMITTED",
                          "ORGANIZATION_MEMBERSHIP_REQUIRED",
                          "ORGANIZATION_ADMIN_REQUIRED",
                          "ENTERPRISE_PLAN_REQUIRED",
                          "SSO_DISABLED",
                          "SSO_DOMAIN_NOT_VERIFIED",
                          "SSO_PROVIDER_LIMIT_REACHED",
                          "ORGANIZATION_PLAN_REQUIRED",
                          "AUDIT_LOGS_DISABLED",
                          "ACCESS_REQUESTS_DISABLED",
                          "ACCESS_REQUEST_ORGANIZATION_REQUIRED",
                          "SKILL_EDITOR_ACCESS_REQUIRED",
                          "SECRET_ADMIN_ACCESS_REQUIRED",
                          "WORKSPACE_RESOURCE_LIMIT_REACHED",
                          "PUBLIC_SHARING_NOT_ALLOWED",
                          "CREDENTIAL_ADMIN_ACCESS_REQUIRED",
                          "MCP_SERVER_URL_NOT_ALLOWED",
                          "WORKSPACE_PLAN_CAPABILITY_REQUIRED",
                          "CHAT_AUTH_MODE_NOT_PERMITTED",
                          "CONNECTOR_MANAGED_RESOURCE_READ_ONLY",
                          "PERMISSION_GROUP_CAPABILITY_BLOCKED",
                          "INTEGRATION_NOT_ALLOWED",
                          "INSUFFICIENT_SCOPE",
                          "READ_ONLY_API_KEY",
                          "SCIM_MANAGED_MEMBERSHIP",
                          "FEATURE_NOT_ENABLED"
                        ],
                        "title": "Forbidden detail code",
                        "description": "Stable cause code for an actionable `403` response."
                      }
                    },
                    "required": [
                      "code"
                    ],
                    "additionalProperties": {
                      "description": "Additional context for this refusal."
                    },
                    "title": "Actionable forbidden details",
                    "description": "Machine-readable cause and optional context for an actionable `403` response."
                  },
                  {
                    "description": "Other structured context defined by the specific error."
                  }
                ]
              },
              "requestId": {
                "description": "Identifier of this request, the same id as the `x-request-id` response header. Quote it when contacting support.",
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false,
            "description": "Canonical error details."
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false,
        "title": "v2 error response",
        "description": "Canonical error envelope returned by the public v2 API.",
        "examples": [
          {
            "error": {
              "code": "BAD_REQUEST",
              "message": "The request is invalid."
            }
          }
        ]
      },
      "example": {
        "error": {
          "code": "FORBIDDEN",
          "message": "Insufficient workspace permissions",
          "details": {
            "code": "INSUFFICIENT_WORKSPACE_ROLE"
          }
        }
      }
    }
  }
}

```

### 404

```json

{
  "description": "The requested resource was not found.",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable machine-readable error code."
              },
              "message": {
                "type": "string",
                "description": "Human-readable explanation of the error."
              },
              "details": {
                "description": "Structured error context whose keys depend on the error. Actionable `403` responses use the `V2ActionableForbiddenDetails` shape; validation failures may return issue arrays instead.",
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string",
                        "enum": [
                          "INSUFFICIENT_WORKSPACE_ROLE",
                          "PERSONAL_API_KEYS_DISABLED",
                          "WORKSPACE_KEY_OPERATION_NOT_PERMITTED",
                          "PRINCIPAL_KIND_NOT_PERMITTED",
                          "ORGANIZATION_MEMBERSHIP_REQUIRED",
                          "ORGANIZATION_ADMIN_REQUIRED",
                          "ENTERPRISE_PLAN_REQUIRED",
                          "SSO_DISABLED",
                          "SSO_DOMAIN_NOT_VERIFIED",
                          "SSO_PROVIDER_LIMIT_REACHED",
                          "ORGANIZATION_PLAN_REQUIRED",
                          "AUDIT_LOGS_DISABLED",
                          "ACCESS_REQUESTS_DISABLED",
                          "ACCESS_REQUEST_ORGANIZATION_REQUIRED",
                          "SKILL_EDITOR_ACCESS_REQUIRED",
                          "SECRET_ADMIN_ACCESS_REQUIRED",
                          "WORKSPACE_RESOURCE_LIMIT_REACHED",
                          "PUBLIC_SHARING_NOT_ALLOWED",
                          "CREDENTIAL_ADMIN_ACCESS_REQUIRED",
                          "MCP_SERVER_URL_NOT_ALLOWED",
                          "WORKSPACE_PLAN_CAPABILITY_REQUIRED",
                          "CHAT_AUTH_MODE_NOT_PERMITTED",
                          "CONNECTOR_MANAGED_RESOURCE_READ_ONLY",
                          "PERMISSION_GROUP_CAPABILITY_BLOCKED",
                          "INTEGRATION_NOT_ALLOWED",
                          "INSUFFICIENT_SCOPE",
                          "READ_ONLY_API_KEY",
                          "SCIM_MANAGED_MEMBERSHIP",
                          "FEATURE_NOT_ENABLED"
                        ],
                        "title": "Forbidden detail code",
                        "description": "Stable cause code for an actionable `403` response."
                      }
                    },
                    "required": [
                      "code"
                    ],
                    "additionalProperties": {
                      "description": "Additional context for this refusal."
                    },
                    "title": "Actionable forbidden details",
                    "description": "Machine-readable cause and optional context for an actionable `403` response."
                  },
                  {
                    "description": "Other structured context defined by the specific error."
                  }
                ]
              },
              "requestId": {
                "description": "Identifier of this request, the same id as the `x-request-id` response header. Quote it when contacting support.",
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false,
            "description": "Canonical error details."
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false,
        "title": "v2 error response",
        "description": "Canonical error envelope returned by the public v2 API.",
        "examples": [
          {
            "error": {
              "code": "BAD_REQUEST",
              "message": "The request is invalid."
            }
          }
        ]
      },
      "example": {
        "error": {
          "code": "NOT_FOUND",
          "message": "Not found"
        }
      }
    }
  }
}

```

### 409

```json

{
  "description": "The request conflicts with current resource state.",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable machine-readable error code."
              },
              "message": {
                "type": "string",
                "description": "Human-readable explanation of the error."
              },
              "details": {
                "description": "Structured error context whose keys depend on the error. Actionable `403` responses use the `V2ActionableForbiddenDetails` shape; validation failures may return issue arrays instead.",
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string",
                        "enum": [
                          "INSUFFICIENT_WORKSPACE_ROLE",
                          "PERSONAL_API_KEYS_DISABLED",
                          "WORKSPACE_KEY_OPERATION_NOT_PERMITTED",
                          "PRINCIPAL_KIND_NOT_PERMITTED",
                          "ORGANIZATION_MEMBERSHIP_REQUIRED",
                          "ORGANIZATION_ADMIN_REQUIRED",
                          "ENTERPRISE_PLAN_REQUIRED",
                          "SSO_DISABLED",
                          "SSO_DOMAIN_NOT_VERIFIED",
                          "SSO_PROVIDER_LIMIT_REACHED",
                          "ORGANIZATION_PLAN_REQUIRED",
                          "AUDIT_LOGS_DISABLED",
                          "ACCESS_REQUESTS_DISABLED",
                          "ACCESS_REQUEST_ORGANIZATION_REQUIRED",
                          "SKILL_EDITOR_ACCESS_REQUIRED",
                          "SECRET_ADMIN_ACCESS_REQUIRED",
                          "WORKSPACE_RESOURCE_LIMIT_REACHED",
                          "PUBLIC_SHARING_NOT_ALLOWED",
                          "CREDENTIAL_ADMIN_ACCESS_REQUIRED",
                          "MCP_SERVER_URL_NOT_ALLOWED",
                          "WORKSPACE_PLAN_CAPABILITY_REQUIRED",
                          "CHAT_AUTH_MODE_NOT_PERMITTED",
                          "CONNECTOR_MANAGED_RESOURCE_READ_ONLY",
                          "PERMISSION_GROUP_CAPABILITY_BLOCKED",
                          "INTEGRATION_NOT_ALLOWED",
                          "INSUFFICIENT_SCOPE",
                          "READ_ONLY_API_KEY",
                          "SCIM_MANAGED_MEMBERSHIP",
                          "FEATURE_NOT_ENABLED"
                        ],
                        "title": "Forbidden detail code",
                        "description": "Stable cause code for an actionable `403` response."
                      }
                    },
                    "required": [
                      "code"
                    ],
                    "additionalProperties": {
                      "description": "Additional context for this refusal."
                    },
                    "title": "Actionable forbidden details",
                    "description": "Machine-readable cause and optional context for an actionable `403` response."
                  },
                  {
                    "description": "Other structured context defined by the specific error."
                  }
                ]
              },
              "requestId": {
                "description": "Identifier of this request, the same id as the `x-request-id` response header. Quote it when contacting support.",
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false,
            "description": "Canonical error details."
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false,
        "title": "v2 error response",
        "description": "Canonical error envelope returned by the public v2 API.",
        "examples": [
          {
            "error": {
              "code": "BAD_REQUEST",
              "message": "The request is invalid."
            }
          }
        ]
      },
      "example": {
        "error": {
          "code": "CONFLICT",
          "message": "The request conflicts with current resource state"
        }
      }
    }
  }
}

```

### 413

```json

{
  "description": "The request, or a resource collection it must materialize, exceeds the allowed size: an oversized request body, a generated artifact past the download ceiling, or a workspace folder tree too large to load in full.",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable machine-readable error code."
              },
              "message": {
                "type": "string",
                "description": "Human-readable explanation of the error."
              },
              "details": {
                "description": "Structured error context whose keys depend on the error. Actionable `403` responses use the `V2ActionableForbiddenDetails` shape; validation failures may return issue arrays instead.",
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string",
                        "enum": [
                          "INSUFFICIENT_WORKSPACE_ROLE",
                          "PERSONAL_API_KEYS_DISABLED",
                          "WORKSPACE_KEY_OPERATION_NOT_PERMITTED",
                          "PRINCIPAL_KIND_NOT_PERMITTED",
                          "ORGANIZATION_MEMBERSHIP_REQUIRED",
                          "ORGANIZATION_ADMIN_REQUIRED",
                          "ENTERPRISE_PLAN_REQUIRED",
                          "SSO_DISABLED",
                          "SSO_DOMAIN_NOT_VERIFIED",
                          "SSO_PROVIDER_LIMIT_REACHED",
                          "ORGANIZATION_PLAN_REQUIRED",
                          "AUDIT_LOGS_DISABLED",
                          "ACCESS_REQUESTS_DISABLED",
                          "ACCESS_REQUEST_ORGANIZATION_REQUIRED",
                          "SKILL_EDITOR_ACCESS_REQUIRED",
                          "SECRET_ADMIN_ACCESS_REQUIRED",
                          "WORKSPACE_RESOURCE_LIMIT_REACHED",
                          "PUBLIC_SHARING_NOT_ALLOWED",
                          "CREDENTIAL_ADMIN_ACCESS_REQUIRED",
                          "MCP_SERVER_URL_NOT_ALLOWED",
                          "WORKSPACE_PLAN_CAPABILITY_REQUIRED",
                          "CHAT_AUTH_MODE_NOT_PERMITTED",
                          "CONNECTOR_MANAGED_RESOURCE_READ_ONLY",
                          "PERMISSION_GROUP_CAPABILITY_BLOCKED",
                          "INTEGRATION_NOT_ALLOWED",
                          "INSUFFICIENT_SCOPE",
                          "READ_ONLY_API_KEY",
                          "SCIM_MANAGED_MEMBERSHIP",
                          "FEATURE_NOT_ENABLED"
                        ],
                        "title": "Forbidden detail code",
                        "description": "Stable cause code for an actionable `403` response."
                      }
                    },
                    "required": [
                      "code"
                    ],
                    "additionalProperties": {
                      "description": "Additional context for this refusal."
                    },
                    "title": "Actionable forbidden details",
                    "description": "Machine-readable cause and optional context for an actionable `403` response."
                  },
                  {
                    "description": "Other structured context defined by the specific error."
                  }
                ]
              },
              "requestId": {
                "description": "Identifier of this request, the same id as the `x-request-id` response header. Quote it when contacting support.",
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false,
            "description": "Canonical error details."
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false,
        "title": "v2 error response",
        "description": "Canonical error envelope returned by the public v2 API.",
        "examples": [
          {
            "error": {
              "code": "BAD_REQUEST",
              "message": "The request is invalid."
            }
          }
        ]
      },
      "example": {
        "error": {
          "code": "PAYLOAD_TOO_LARGE",
          "message": "Request body is too large"
        }
      }
    }
  }
}

```

### 415

```json

{
  "description": "The request uses an unsupported media type.",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable machine-readable error code."
              },
              "message": {
                "type": "string",
                "description": "Human-readable explanation of the error."
              },
              "details": {
                "description": "Structured error context whose keys depend on the error. Actionable `403` responses use the `V2ActionableForbiddenDetails` shape; validation failures may return issue arrays instead.",
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string",
                        "enum": [
                          "INSUFFICIENT_WORKSPACE_ROLE",
                          "PERSONAL_API_KEYS_DISABLED",
                          "WORKSPACE_KEY_OPERATION_NOT_PERMITTED",
                          "PRINCIPAL_KIND_NOT_PERMITTED",
                          "ORGANIZATION_MEMBERSHIP_REQUIRED",
                          "ORGANIZATION_ADMIN_REQUIRED",
                          "ENTERPRISE_PLAN_REQUIRED",
                          "SSO_DISABLED",
                          "SSO_DOMAIN_NOT_VERIFIED",
                          "SSO_PROVIDER_LIMIT_REACHED",
                          "ORGANIZATION_PLAN_REQUIRED",
                          "AUDIT_LOGS_DISABLED",
                          "ACCESS_REQUESTS_DISABLED",
                          "ACCESS_REQUEST_ORGANIZATION_REQUIRED",
                          "SKILL_EDITOR_ACCESS_REQUIRED",
                          "SECRET_ADMIN_ACCESS_REQUIRED",
                          "WORKSPACE_RESOURCE_LIMIT_REACHED",
                          "PUBLIC_SHARING_NOT_ALLOWED",
                          "CREDENTIAL_ADMIN_ACCESS_REQUIRED",
                          "MCP_SERVER_URL_NOT_ALLOWED",
                          "WORKSPACE_PLAN_CAPABILITY_REQUIRED",
                          "CHAT_AUTH_MODE_NOT_PERMITTED",
                          "CONNECTOR_MANAGED_RESOURCE_READ_ONLY",
                          "PERMISSION_GROUP_CAPABILITY_BLOCKED",
                          "INTEGRATION_NOT_ALLOWED",
                          "INSUFFICIENT_SCOPE",
                          "READ_ONLY_API_KEY",
                          "SCIM_MANAGED_MEMBERSHIP",
                          "FEATURE_NOT_ENABLED"
                        ],
                        "title": "Forbidden detail code",
                        "description": "Stable cause code for an actionable `403` response."
                      }
                    },
                    "required": [
                      "code"
                    ],
                    "additionalProperties": {
                      "description": "Additional context for this refusal."
                    },
                    "title": "Actionable forbidden details",
                    "description": "Machine-readable cause and optional context for an actionable `403` response."
                  },
                  {
                    "description": "Other structured context defined by the specific error."
                  }
                ]
              },
              "requestId": {
                "description": "Identifier of this request, the same id as the `x-request-id` response header. Quote it when contacting support.",
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false,
            "description": "Canonical error details."
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false,
        "title": "v2 error response",
        "description": "Canonical error envelope returned by the public v2 API.",
        "examples": [
          {
            "error": {
              "code": "BAD_REQUEST",
              "message": "The request is invalid."
            }
          }
        ]
      },
      "example": {
        "error": {
          "code": "UNSUPPORTED_MEDIA_TYPE",
          "message": "Request body must be sent as application/json"
        }
      }
    }
  }
}

```

### 423

```json

{
  "description": "The resource is temporarily locked or unavailable; retry the request.",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable machine-readable error code."
              },
              "message": {
                "type": "string",
                "description": "Human-readable explanation of the error."
              },
              "details": {
                "description": "Structured error context whose keys depend on the error. Actionable `403` responses use the `V2ActionableForbiddenDetails` shape; validation failures may return issue arrays instead.",
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string",
                        "enum": [
                          "INSUFFICIENT_WORKSPACE_ROLE",
                          "PERSONAL_API_KEYS_DISABLED",
                          "WORKSPACE_KEY_OPERATION_NOT_PERMITTED",
                          "PRINCIPAL_KIND_NOT_PERMITTED",
                          "ORGANIZATION_MEMBERSHIP_REQUIRED",
                          "ORGANIZATION_ADMIN_REQUIRED",
                          "ENTERPRISE_PLAN_REQUIRED",
                          "SSO_DISABLED",
                          "SSO_DOMAIN_NOT_VERIFIED",
                          "SSO_PROVIDER_LIMIT_REACHED",
                          "ORGANIZATION_PLAN_REQUIRED",
                          "AUDIT_LOGS_DISABLED",
                          "ACCESS_REQUESTS_DISABLED",
                          "ACCESS_REQUEST_ORGANIZATION_REQUIRED",
                          "SKILL_EDITOR_ACCESS_REQUIRED",
                          "SECRET_ADMIN_ACCESS_REQUIRED",
                          "WORKSPACE_RESOURCE_LIMIT_REACHED",
                          "PUBLIC_SHARING_NOT_ALLOWED",
                          "CREDENTIAL_ADMIN_ACCESS_REQUIRED",
                          "MCP_SERVER_URL_NOT_ALLOWED",
                          "WORKSPACE_PLAN_CAPABILITY_REQUIRED",
                          "CHAT_AUTH_MODE_NOT_PERMITTED",
                          "CONNECTOR_MANAGED_RESOURCE_READ_ONLY",
                          "PERMISSION_GROUP_CAPABILITY_BLOCKED",
                          "INTEGRATION_NOT_ALLOWED",
                          "INSUFFICIENT_SCOPE",
                          "READ_ONLY_API_KEY",
                          "SCIM_MANAGED_MEMBERSHIP",
                          "FEATURE_NOT_ENABLED"
                        ],
                        "title": "Forbidden detail code",
                        "description": "Stable cause code for an actionable `403` response."
                      }
                    },
                    "required": [
                      "code"
                    ],
                    "additionalProperties": {
                      "description": "Additional context for this refusal."
                    },
                    "title": "Actionable forbidden details",
                    "description": "Machine-readable cause and optional context for an actionable `403` response."
                  },
                  {
                    "description": "Other structured context defined by the specific error."
                  }
                ]
              },
              "requestId": {
                "description": "Identifier of this request, the same id as the `x-request-id` response header. Quote it when contacting support.",
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false,
            "description": "Canonical error details."
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false,
        "title": "v2 error response",
        "description": "Canonical error envelope returned by the public v2 API.",
        "examples": [
          {
            "error": {
              "code": "BAD_REQUEST",
              "message": "The request is invalid."
            }
          }
        ]
      },
      "example": {
        "error": {
          "code": "LOCKED",
          "message": "Workflow is locked"
        }
      }
    }
  }
}

```

### 429

```json

{
  "description": "The caller exceeded the request rate limit.",
  "headers": {
    "Retry-After": {
      "description": "Seconds to wait before retrying, sent on `429` and `503`. Add jitter rather than retrying at exactly this offset.",
      "schema": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "title": "Retry after",
        "description": "Seconds to wait before retrying, sent on `429` and `503`. Add jitter rather than retrying at exactly this offset."
      }
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable machine-readable error code."
              },
              "message": {
                "type": "string",
                "description": "Human-readable explanation of the error."
              },
              "details": {
                "description": "Structured error context whose keys depend on the error. Actionable `403` responses use the `V2ActionableForbiddenDetails` shape; validation failures may return issue arrays instead.",
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string",
                        "enum": [
                          "INSUFFICIENT_WORKSPACE_ROLE",
                          "PERSONAL_API_KEYS_DISABLED",
                          "WORKSPACE_KEY_OPERATION_NOT_PERMITTED",
                          "PRINCIPAL_KIND_NOT_PERMITTED",
                          "ORGANIZATION_MEMBERSHIP_REQUIRED",
                          "ORGANIZATION_ADMIN_REQUIRED",
                          "ENTERPRISE_PLAN_REQUIRED",
                          "SSO_DISABLED",
                          "SSO_DOMAIN_NOT_VERIFIED",
                          "SSO_PROVIDER_LIMIT_REACHED",
                          "ORGANIZATION_PLAN_REQUIRED",
                          "AUDIT_LOGS_DISABLED",
                          "ACCESS_REQUESTS_DISABLED",
                          "ACCESS_REQUEST_ORGANIZATION_REQUIRED",
                          "SKILL_EDITOR_ACCESS_REQUIRED",
                          "SECRET_ADMIN_ACCESS_REQUIRED",
                          "WORKSPACE_RESOURCE_LIMIT_REACHED",
                          "PUBLIC_SHARING_NOT_ALLOWED",
                          "CREDENTIAL_ADMIN_ACCESS_REQUIRED",
                          "MCP_SERVER_URL_NOT_ALLOWED",
                          "WORKSPACE_PLAN_CAPABILITY_REQUIRED",
                          "CHAT_AUTH_MODE_NOT_PERMITTED",
                          "CONNECTOR_MANAGED_RESOURCE_READ_ONLY",
                          "PERMISSION_GROUP_CAPABILITY_BLOCKED",
                          "INTEGRATION_NOT_ALLOWED",
                          "INSUFFICIENT_SCOPE",
                          "READ_ONLY_API_KEY",
                          "SCIM_MANAGED_MEMBERSHIP",
                          "FEATURE_NOT_ENABLED"
                        ],
                        "title": "Forbidden detail code",
                        "description": "Stable cause code for an actionable `403` response."
                      }
                    },
                    "required": [
                      "code"
                    ],
                    "additionalProperties": {
                      "description": "Additional context for this refusal."
                    },
                    "title": "Actionable forbidden details",
                    "description": "Machine-readable cause and optional context for an actionable `403` response."
                  },
                  {
                    "description": "Other structured context defined by the specific error."
                  }
                ]
              },
              "requestId": {
                "description": "Identifier of this request, the same id as the `x-request-id` response header. Quote it when contacting support.",
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false,
            "description": "Canonical error details."
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false,
        "title": "v2 error response",
        "description": "Canonical error envelope returned by the public v2 API.",
        "examples": [
          {
            "error": {
              "code": "BAD_REQUEST",
              "message": "The request is invalid."
            }
          }
        ]
      },
      "example": {
        "error": {
          "code": "RATE_LIMITED",
          "message": "API rate limit exceeded",
          "details": {
            "retryAfter": "2026-01-01T00:00:30.000Z"
          }
        }
      }
    }
  }
}

```

### 500

```json

{
  "description": "An unexpected server error occurred.",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable machine-readable error code."
              },
              "message": {
                "type": "string",
                "description": "Human-readable explanation of the error."
              },
              "details": {
                "description": "Structured error context whose keys depend on the error. Actionable `403` responses use the `V2ActionableForbiddenDetails` shape; validation failures may return issue arrays instead.",
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string",
                        "enum": [
                          "INSUFFICIENT_WORKSPACE_ROLE",
                          "PERSONAL_API_KEYS_DISABLED",
                          "WORKSPACE_KEY_OPERATION_NOT_PERMITTED",
                          "PRINCIPAL_KIND_NOT_PERMITTED",
                          "ORGANIZATION_MEMBERSHIP_REQUIRED",
                          "ORGANIZATION_ADMIN_REQUIRED",
                          "ENTERPRISE_PLAN_REQUIRED",
                          "SSO_DISABLED",
                          "SSO_DOMAIN_NOT_VERIFIED",
                          "SSO_PROVIDER_LIMIT_REACHED",
                          "ORGANIZATION_PLAN_REQUIRED",
                          "AUDIT_LOGS_DISABLED",
                          "ACCESS_REQUESTS_DISABLED",
                          "ACCESS_REQUEST_ORGANIZATION_REQUIRED",
                          "SKILL_EDITOR_ACCESS_REQUIRED",
                          "SECRET_ADMIN_ACCESS_REQUIRED",
                          "WORKSPACE_RESOURCE_LIMIT_REACHED",
                          "PUBLIC_SHARING_NOT_ALLOWED",
                          "CREDENTIAL_ADMIN_ACCESS_REQUIRED",
                          "MCP_SERVER_URL_NOT_ALLOWED",
                          "WORKSPACE_PLAN_CAPABILITY_REQUIRED",
                          "CHAT_AUTH_MODE_NOT_PERMITTED",
                          "CONNECTOR_MANAGED_RESOURCE_READ_ONLY",
                          "PERMISSION_GROUP_CAPABILITY_BLOCKED",
                          "INTEGRATION_NOT_ALLOWED",
                          "INSUFFICIENT_SCOPE",
                          "READ_ONLY_API_KEY",
                          "SCIM_MANAGED_MEMBERSHIP",
                          "FEATURE_NOT_ENABLED"
                        ],
                        "title": "Forbidden detail code",
                        "description": "Stable cause code for an actionable `403` response."
                      }
                    },
                    "required": [
                      "code"
                    ],
                    "additionalProperties": {
                      "description": "Additional context for this refusal."
                    },
                    "title": "Actionable forbidden details",
                    "description": "Machine-readable cause and optional context for an actionable `403` response."
                  },
                  {
                    "description": "Other structured context defined by the specific error."
                  }
                ]
              },
              "requestId": {
                "description": "Identifier of this request, the same id as the `x-request-id` response header. Quote it when contacting support.",
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false,
            "description": "Canonical error details."
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false,
        "title": "v2 error response",
        "description": "Canonical error envelope returned by the public v2 API.",
        "examples": [
          {
            "error": {
              "code": "BAD_REQUEST",
              "message": "The request is invalid."
            }
          }
        ]
      },
      "example": {
        "error": {
          "code": "INTERNAL_ERROR",
          "message": "Internal server error"
        }
      }
    }
  }
}

```

### 503

```json

{
  "description": "A required service is temporarily unavailable. When present, `Retry-After` gives the minimum seconds to wait; add jitter before retrying. Check operation-specific guidance before repeating a change after an uncertain response.",
  "headers": {
    "Retry-After": {
      "description": "Seconds to wait before retrying, sent on `429` and `503`. Add jitter rather than retrying at exactly this offset.",
      "schema": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "title": "Retry after",
        "description": "Seconds to wait before retrying, sent on `429` and `503`. Add jitter rather than retrying at exactly this offset."
      }
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable machine-readable error code."
              },
              "message": {
                "type": "string",
                "description": "Human-readable explanation of the error."
              },
              "details": {
                "description": "Structured error context whose keys depend on the error. Actionable `403` responses use the `V2ActionableForbiddenDetails` shape; validation failures may return issue arrays instead.",
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string",
                        "enum": [
                          "INSUFFICIENT_WORKSPACE_ROLE",
                          "PERSONAL_API_KEYS_DISABLED",
                          "WORKSPACE_KEY_OPERATION_NOT_PERMITTED",
                          "PRINCIPAL_KIND_NOT_PERMITTED",
                          "ORGANIZATION_MEMBERSHIP_REQUIRED",
                          "ORGANIZATION_ADMIN_REQUIRED",
                          "ENTERPRISE_PLAN_REQUIRED",
                          "SSO_DISABLED",
                          "SSO_DOMAIN_NOT_VERIFIED",
                          "SSO_PROVIDER_LIMIT_REACHED",
                          "ORGANIZATION_PLAN_REQUIRED",
                          "AUDIT_LOGS_DISABLED",
                          "ACCESS_REQUESTS_DISABLED",
                          "ACCESS_REQUEST_ORGANIZATION_REQUIRED",
                          "SKILL_EDITOR_ACCESS_REQUIRED",
                          "SECRET_ADMIN_ACCESS_REQUIRED",
                          "WORKSPACE_RESOURCE_LIMIT_REACHED",
                          "PUBLIC_SHARING_NOT_ALLOWED",
                          "CREDENTIAL_ADMIN_ACCESS_REQUIRED",
                          "MCP_SERVER_URL_NOT_ALLOWED",
                          "WORKSPACE_PLAN_CAPABILITY_REQUIRED",
                          "CHAT_AUTH_MODE_NOT_PERMITTED",
                          "CONNECTOR_MANAGED_RESOURCE_READ_ONLY",
                          "PERMISSION_GROUP_CAPABILITY_BLOCKED",
                          "INTEGRATION_NOT_ALLOWED",
                          "INSUFFICIENT_SCOPE",
                          "READ_ONLY_API_KEY",
                          "SCIM_MANAGED_MEMBERSHIP",
                          "FEATURE_NOT_ENABLED"
                        ],
                        "title": "Forbidden detail code",
                        "description": "Stable cause code for an actionable `403` response."
                      }
                    },
                    "required": [
                      "code"
                    ],
                    "additionalProperties": {
                      "description": "Additional context for this refusal."
                    },
                    "title": "Actionable forbidden details",
                    "description": "Machine-readable cause and optional context for an actionable `403` response."
                  },
                  {
                    "description": "Other structured context defined by the specific error."
                  }
                ]
              },
              "requestId": {
                "description": "Identifier of this request, the same id as the `x-request-id` response header. Quote it when contacting support.",
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false,
            "description": "Canonical error details."
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false,
        "title": "v2 error response",
        "description": "Canonical error envelope returned by the public v2 API.",
        "examples": [
          {
            "error": {
              "code": "BAD_REQUEST",
              "message": "The request is invalid."
            }
          }
        ]
      },
      "example": {
        "error": {
          "code": "SERVICE_UNAVAILABLE",
          "message": "Service temporarily unavailable"
        }
      }
    }
  }
}

```

## Referenced schemas

The following definitions preserve recursive references and composition exactly.

```json

{
  "#/components/schemas/ApplyWorkspaceSourceBody": {
    "type": "object",
    "properties": {
      "files": {
        "type": "object",
        "propertyNames": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "additionalProperties": {
          "type": "string"
        },
        "description": "Directory path → text for every managed kind: declarations (`tables/leads.ts`) and workflow folders (`workflows/ingest/workflow.ts`, `functions/*`, `.sim/lock.json`, `.sim/base.json`). A workflow folder sent with only its `.sim/base.json` is unchanged."
      },
      "blobs": {
        "description": "Binary files by path, with the SHA-256 and size of their bytes. Their bytes must be staged first: `sim workspaces source apply` stages them, or upload them to `POST /api/v2/workspaces/{workspaceId}/source/blobs` (not available over MCP). An apply with any missing is refused with `E_BLOB_MISSING` and writes nothing.",
        "maxItems": 20000,
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "path": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024,
              "description": "Directory path of the binary file."
            },
            "sha256": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}$",
              "description": "SHA-256 of the bytes, lowercase hex."
            },
            "size": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10000000,
              "description": "Bytes."
            }
          },
          "required": [
            "path",
            "sha256",
            "size"
          ],
          "additionalProperties": false
        }
      },
      "base": {
        "type": "object",
        "properties": {
          "version": {
            "type": "number",
            "const": 1,
            "description": "Base format version."
          },
          "workspaceId": {
            "type": "string",
            "description": "Workspace the directory was read from."
          },
          "resources": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Stored id the key is bound to."
                },
                "fingerprint": {
                  "description": "`rf1:` fingerprint of the resource as last read; absent for a workflow, and for a binary file listed without `sha256` until the client records its hash.",
                  "type": "string"
                },
                "columns": {
                  "description": "Table column key → stored column.",
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Stored column id."
                      },
                      "options": {
                        "description": "Select option name → option id.",
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {
                          "type": "string"
                        }
                      }
                    },
                    "required": [
                      "id"
                    ]
                  }
                },
                "blobs": {
                  "description": "Binary file name → its stored id, revision and hash as last read.",
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Stored id of the binary file."
                      },
                      "rev": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "string"
                          }
                        ],
                        "description": "Content revision as last read."
                      },
                      "sha256": {
                        "type": "string",
                        "pattern": "^[0-9a-f]{64}$",
                        "description": "SHA-256 of the bytes, lowercase hex."
                      }
                    },
                    "required": [
                      "id",
                      "rev",
                      "sha256"
                    ]
                  }
                },
                "rows": {
                  "description": "A table’s managed rows, as last read.",
                  "type": "object",
                  "properties": {
                    "fingerprint": {
                      "type": "string",
                      "description": "`rf1:` fingerprint of the managed rows as last read."
                    },
                    "version": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991,
                      "description": "The table’s row version as last read; it moves on every row write."
                    }
                  },
                  "required": [
                    "fingerprint",
                    "version"
                  ],
                  "additionalProperties": {
                    "description": "An `x-` extension field, kept as written."
                  }
                }
              },
              "required": [
                "id"
              ],
              "additionalProperties": {
                "description": "An `x-` extension field, kept as written."
              },
              "description": "One resource in the base."
            },
            "description": "`kind:key` → the stored resource and its fingerprint."
          }
        },
        "required": [
          "version",
          "workspaceId",
          "resources"
        ],
        "additionalProperties": {
          "description": "An `x-` extension field, kept as written."
        },
        "description": "`.sim/base.json`: per resource, the id and fingerprint the directory was read at. Apply compares it with the server to tell a local edit from a server change."
      },
      "kinds": {
        "maxItems": 10,
        "type": "array",
        "items": {
          "type": "string",
          "enum": [
            "secret",
            "credential",
            "custom-tool",
            "skill",
            "mcp-server",
            "table",
            "knowledge-base",
            "file",
            "workflow",
            "deployment"
          ],
          "description": "A resource kind: `secret`, `credential`, `custom-tool`, `skill`, `mcp-server`, `table`, `knowledge-base`, `file`, `workflow`, `deployment`."
        },
        "description": "The kind folders the directory holds, empty ones included. A kind is managed only when listed here or when a file of it is sent."
      },
      "options": {
        "description": "How far the apply may go.",
        "type": "object",
        "properties": {
          "allowDelete": {
            "description": "Delete resources, columns and data the directory no longer declares.",
            "type": "boolean"
          },
          "only": {
            "description": "Apply only these kinds.",
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "secret",
                "credential",
                "custom-tool",
                "skill",
                "mcp-server",
                "table",
                "knowledge-base",
                "file",
                "workflow",
                "deployment"
              ],
              "description": "A resource kind: `secret`, `credential`, `custom-tool`, `skill`, `mcp-server`, `table`, `knowledge-base`, `file`, `workflow`, `deployment`."
            }
          }
        },
        "additionalProperties": false
      },
      "provenance": {
        "description": "Where the directory came from, for the audit log.",
        "type": "object",
        "properties": {
          "client": {
            "type": "string",
            "enum": [
              "cli",
              "api"
            ],
            "description": "What submitted the directory."
          },
          "gitSha": {
            "description": "The commit the directory was taken from; recorded in the audit log.",
            "type": "string",
            "pattern": "^[0-9a-f]{7,64}$"
          },
          "repo": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512,
            "description": "The repository the source was taken from (its remote URL); recorded in the audit log."
          }
        },
        "required": [
          "client"
        ],
        "additionalProperties": false
      }
    },
    "required": [
      "files",
      "kinds"
    ],
    "additionalProperties": false,
    "title": "Apply workspace source body",
    "description": "The directory files, its managed kinds and the base they were read with.",
    "examples": [
      {
        "files": {
          "tables/leads.ts": "// @sim-sdk 1\nimport { column, defineTable } from '@sim/workflow-sdk/workspace'\n\nexport default defineTable({\n  name: 'leads',\n  columns: {\n    email: column.string({ required: true, unique: true }),\n    status: column.select({ options: ['new', 'won'] }),\n  },\n})\n"
        },
        "kinds": [
          "table"
        ],
        "base": {
          "version": 1,
          "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64",
          "resources": {
            "table:leads": {
              "id": "tbl_5c0e2a7b9d1f4e3a8b6c2d0f7e9a1b3c",
              "fingerprint": "rf1:4b8d2f6a0c3e7b1d5f9a2c6e0b4d8f3a7c1e5b9d2f6a0c4e8b3d7f1a5c9e2b6d",
              "columns": {
                "email": {
                  "id": "col_8e1c4a7b2d5f"
                },
                "status": {
                  "id": "col_3b6d9f2a5c8e",
                  "options": {
                    "new": "k2Pq9x",
                    "won": "r7Tn4m"
                  }
                }
              }
            }
          }
        }
      }
    ]
  },
  "#/components/headers/X-RateLimit-Limit": {
    "description": "Maximum requests allowed in the current window.",
    "schema": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991,
      "title": "Rate limit",
      "description": "Maximum requests allowed in the current window."
    }
  },
  "#/components/headers/X-RateLimit-Remaining": {
    "description": "Requests remaining in the current window.",
    "schema": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991,
      "title": "Rate limit remaining",
      "description": "Requests remaining in the current window."
    }
  },
  "#/components/headers/X-RateLimit-Reset": {
    "description": "ISO 8601 timestamp when the current rate-limit window resets.",
    "schema": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
      "title": "Rate limit reset",
      "description": "ISO 8601 timestamp when the current rate-limit window resets."
    }
  },
  "#/components/schemas/ApplyWorkspaceSourceResponse": {
    "type": "object",
    "properties": {
      "data": {
        "type": "object",
        "properties": {
          "workspaceId": {
            "type": "string",
            "description": "Workspace id."
          },
          "dryRun": {
            "type": "boolean",
            "description": "True when nothing was written because `dryRun` was set."
          },
          "plan": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "secret",
                    "credential",
                    "custom-tool",
                    "skill",
                    "mcp-server",
                    "table",
                    "knowledge-base",
                    "file",
                    "workflow",
                    "deployment"
                  ],
                  "description": "A resource kind: `secret`, `credential`, `custom-tool`, `skill`, `mcp-server`, `table`, `knowledge-base`, `file`, `workflow`, `deployment`."
                },
                "key": {
                  "type": "string",
                  "description": "Resource key."
                },
                "action": {
                  "type": "string",
                  "enum": [
                    "create",
                    "update",
                    "adopt",
                    "delete",
                    "noop"
                  ],
                  "description": "`adopt` binds the key to an existing resource of the same name, then updates it."
                },
                "fields": {
                  "description": "What changes.",
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "destructive": {
                  "description": "Data the change deletes: dropped columns, removed select options and the cells they empty, or a deleted resource. A dry run shows it whether or not `allowDelete` is set.",
                  "type": "object",
                  "properties": {
                    "what": {
                      "type": "string",
                      "description": "What is lost."
                    },
                    "counts": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "description": "How much is lost."
                    }
                  },
                  "required": [
                    "what",
                    "counts"
                  ],
                  "additionalProperties": false
                },
                "id": {
                  "description": "Stored id, once known.",
                  "type": "string"
                },
                "held": {
                  "description": "Held back: the change uses a declared secret the workspace has no value for, or a declared credential key nothing binds to (see its errors). It is not written; the rest of the apply goes ahead.",
                  "type": "boolean",
                  "const": true
                }
              },
              "required": [
                "kind",
                "key",
                "action"
              ],
              "additionalProperties": false,
              "description": "One planned or applied change."
            },
            "description": "Every planned change, no-ops included, in apply order."
          },
          "refuses": {
            "description": "Set on a dry run: whether the apply would refuse. Errors of a change held back (`held`) refuse nothing else; any other error refuses. Absent on an apply.",
            "type": "boolean"
          },
          "applied": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "secret",
                    "credential",
                    "custom-tool",
                    "skill",
                    "mcp-server",
                    "table",
                    "knowledge-base",
                    "file",
                    "workflow",
                    "deployment"
                  ],
                  "description": "A resource kind: `secret`, `credential`, `custom-tool`, `skill`, `mcp-server`, `table`, `knowledge-base`, `file`, `workflow`, `deployment`."
                },
                "key": {
                  "type": "string",
                  "description": "Resource key."
                },
                "action": {
                  "type": "string",
                  "enum": [
                    "create",
                    "update",
                    "adopt",
                    "delete",
                    "noop"
                  ],
                  "description": "`adopt` binds the key to an existing resource of the same name, then updates it."
                },
                "fields": {
                  "description": "What changes.",
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "destructive": {
                  "description": "Data the change deletes: dropped columns, removed select options and the cells they empty, or a deleted resource. A dry run shows it whether or not `allowDelete` is set.",
                  "type": "object",
                  "properties": {
                    "what": {
                      "type": "string",
                      "description": "What is lost."
                    },
                    "counts": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "description": "How much is lost."
                    }
                  },
                  "required": [
                    "what",
                    "counts"
                  ],
                  "additionalProperties": false
                },
                "id": {
                  "description": "Stored id, once known.",
                  "type": "string"
                },
                "held": {
                  "description": "Held back: the change uses a declared secret the workspace has no value for, or a declared credential key nothing binds to (see its errors). It is not written; the rest of the apply goes ahead.",
                  "type": "boolean",
                  "const": true
                }
              },
              "required": [
                "kind",
                "key",
                "action"
              ],
              "additionalProperties": false,
              "description": "One planned or applied change."
            },
            "description": "The changes written, in order."
          },
          "failed": {
            "description": "The change that failed mid-apply. The changes before it are written (`applied`); the rest were not attempted. Applying the same directory again continues.",
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "secret",
                  "credential",
                  "custom-tool",
                  "skill",
                  "mcp-server",
                  "table",
                  "knowledge-base",
                  "file",
                  "workflow",
                  "deployment"
                ],
                "description": "A resource kind: `secret`, `credential`, `custom-tool`, `skill`, `mcp-server`, `table`, `knowledge-base`, `file`, `workflow`, `deployment`."
              },
              "key": {
                "type": "string",
                "description": "Resource key."
              },
              "code": {
                "type": "string",
                "enum": [
                  "E_DECL_SYNTAX",
                  "E_DECL_HEADER",
                  "E_DECL_IMPORT",
                  "E_DECL_EXPORT",
                  "E_DECL_UNSUPPORTED",
                  "E_DECL_DUPLICATE_KEY",
                  "E_DECL_SHAPE",
                  "E_DECL_UNKNOWN_FIELD",
                  "E_DECL_UNKNOWN_FILE",
                  "W_PATH_NOT_SENT",
                  "E_BLOB_MANIFEST",
                  "E_BLOB_MISSING",
                  "E_KEY_INVALID",
                  "W_DECL_SUSPICIOUS_CHARACTER",
                  "E_BASE_JSON",
                  "E_BASE_VERSION",
                  "E_BASE_SHAPE",
                  "E_BASE_UNKNOWN_FIELD",
                  "E_SECRET_NAME",
                  "E_SECRET_MISSING",
                  "W_SECRET_MISSING",
                  "E_CREDENTIAL_MISSING",
                  "E_CREDENTIAL_AMBIGUOUS",
                  "W_CREDENTIAL_MISSING",
                  "W_CREDENTIAL_AMBIGUOUS",
                  "E_TABLE_COLUMN_NAME",
                  "E_TABLE_DUPLICATE_COLUMN",
                  "E_TABLE_TOO_MANY_COLUMNS",
                  "E_TABLE_OPTIONS",
                  "E_TABLE_TYPE_CONVERSION",
                  "E_TABLE_FOLDER",
                  "E_TABLE_ROWS",
                  "I_TABLE_SEED_SKIPPED",
                  "I_TABLE_ROWS_UNKEYED",
                  "W_LIKELY_RENAME",
                  "E_TOOL_SCHEMA",
                  "E_TOOL_CODE",
                  "E_TOOL_STORED_MISSING",
                  "W_TOOL_LITERAL_SECRET",
                  "E_SKILL_FRONTMATTER",
                  "E_MCP_LITERAL_SECRET",
                  "E_MCP_STORED_MISSING",
                  "E_MCP_TOOL_UNKNOWN",
                  "W_MCP_REPLACE",
                  "W_MCP_TOOLS_UNCHECKED",
                  "E_FILE_PATH",
                  "E_FILE_PATH_COLLISION",
                  "E_FILE_NAME",
                  "E_FILE_TOO_LARGE",
                  "E_FILE_CONTENT",
                  "E_KB_EMBEDDING_IMMUTABLE",
                  "E_KB_EMBEDDING_MODEL",
                  "E_KB_DOC_AMBIGUOUS",
                  "E_KB_DOC_NAME",
                  "E_KB_DOC_EMPTY",
                  "E_KB_CHUNKING",
                  "E_KB_FOLDER",
                  "W_KB_DOC_UNCHECKED",
                  "W_KB_DOC_FAILED",
                  "I_KB_REEMBED",
                  "I_KB_CHUNKING",
                  "I_KB_PROCESSING",
                  "I_KB_DOCS_UNHASHED",
                  "I_KB_UNMANAGED_DOCS",
                  "I_KB_REPLACE_UNFINISHED",
                  "E_DEPLOY_WORKFLOW",
                  "E_DEPLOY_SECRET",
                  "E_DEPLOY_CHAT_OUTPUT",
                  "E_DEPLOY_CHAT_IDENTIFIER",
                  "E_DEPLOY_PINNED_CHAT",
                  "W_DEPLOYED_DRAFT_CHANGED",
                  "W_DEPLOY_DRAFT_NOT_SOURCE",
                  "E_DEPLOY_DRAFT_NOT_SOURCE_CHAT",
                  "I_DEPLOY_DRAFT_NOT_LIVE",
                  "E_APPLY_NO_BASE",
                  "E_APPLY_FORBIDDEN",
                  "E_APPLY_DELETE_NOT_ALLOWED",
                  "E_APPLY_LOCKED",
                  "E_APPLY_REFUSED",
                  "E_APPLY_FAILED",
                  "E_PLAN_TOO_LARGE",
                  "E_PLAN_REF_DELETED",
                  "E_PLAN_REF_HELD",
                  "W_RESOURCE_IN_USE",
                  "W_TABLE_COLUMN_RENAMED_IN_USE",
                  "E_WORKFLOW_FILES_MISSING",
                  "E_WORKFLOW_FOLDER_COPIED",
                  "W_UNDECLARED",
                  "W_BASE_OTHER_WORKSPACE",
                  "W_PROMOTE_TARGET_DELETED",
                  "W_PROMOTE_DELETES_TARGET_ONLY",
                  "W_SERVER_CHANGED",
                  "W_SERVER_DELETED",
                  "W_SERVER_MOVED",
                  "I_KEY_REBOUND",
                  "E_KEY_RENAMED",
                  "E_APPLY_STALE",
                  "E_LIMIT_EXCEEDED",
                  "E_NAME_TAKEN",
                  "I_FINDINGS_TRUNCATED",
                  "E_SYNTAX",
                  "E_SDK_HEADER",
                  "E_SDK_MAJOR",
                  "E_SDK_MAJOR_OLD",
                  "E_UNSUPPORTED_SYNTAX",
                  "E_WORKFLOW_EXPORT",
                  "E_INVALID_CHARACTER",
                  "E_NUMBER_NOT_FINITE",
                  "W_NUMBER_PRECISION",
                  "E_TOO_MANY_ERRORS",
                  "E_DUPLICATE_NAME",
                  "E_RESERVED_NAME",
                  "E_KEY_OVERRIDE",
                  "E_EMPTY_NAME",
                  "E_LOOKALIKE_NAME",
                  "W_LOOKALIKE_NAME",
                  "W_SUSPICIOUS_CHARACTER",
                  "E_NAME_NOT_LITERAL",
                  "E_UNKNOWN_IDENTIFIER",
                  "E_OUT_OF_SCOPE",
                  "E_UNKNOWN_VARIABLE",
                  "E_DUPLICATE_VARIABLE",
                  "E_VARIABLE_NAME_MISMATCH",
                  "E_INVALID_ENV_NAME",
                  "W_ENV_UNKNOWN",
                  "W_CHILD_INPUT_UNKNOWN",
                  "W_CHILD_NO_START",
                  "W_CHILD_RESULT_PATH",
                  "E_UNKNOWN_SUBFLOW_PROPERTY",
                  "W_FORWARD_REF",
                  "W_REF_NOT_NORMALIZED",
                  "E_REF_UNREPRESENTABLE",
                  "W_REF_OUT_OF_SCOPE",
                  "E_EDGE_SCOPE",
                  "E_EDGE_NOTE",
                  "E_TARGET_TRIGGER",
                  "E_NO_DEFAULT_OUTPUT",
                  "E_DUPLICATE_EDGE",
                  "E_ERROR_PORT_UNSUPPORTED",
                  "W_ERROR_PORT_STORED",
                  "E_UNKNOWN_BRANCH",
                  "E_DUPLICATE_BRANCH_KEY",
                  "E_BRANCH_KEY_COLLIDES",
                  "E_BRANCH_ELSE_LAST",
                  "W_RAW_HANDLE",
                  "W_SUBFLOW_HANDLE_SCOPE",
                  "E_EDGE_CYCLE",
                  "W_EDGE_CYCLE",
                  "W_BRANCH_UNWIRED",
                  "E_UNKNOWN_BUILDER",
                  "E_UNKNOWN_PARAM",
                  "E_FIXED_PARAM",
                  "W_FIELD_NOT_APPLICABLE",
                  "W_REQUIRED_MISSING",
                  "W_UNKNOWN_OPTION",
                  "E_UNKNOWN_OPERATION",
                  "W_UNKNOWN_MODEL",
                  "W_LEGACY_BLOCK_TYPE",
                  "W_UNKNOWN_BLOCK_TYPE",
                  "W_TYPE_NOT_ADDABLE",
                  "I_SCHEDULE_UTC",
                  "E_STORED_VALUE_MISSING",
                  "W_VALUE_KIND",
                  "W_OUT_OF_RANGE",
                  "W_TABLE_FILTER_SHAPE",
                  "W_LITERAL_SECRET",
                  "W_SUBFLOW_COUNT",
                  "W_UNKNOWN_OUTPUT_PATH",
                  "W_OUTPUT_PATH_UNDECLARED",
                  "W_JSON_REF_UNTYPED",
                  "W_LOOP_CONDITION_SYNTAX",
                  "E_CODE_FILE_MISSING",
                  "E_CODE_FILE_PATH",
                  "W_CODE_FILE_INLINED",
                  "W_CODE_FILE_REF_SYNTAX",
                  "W_UNRESOLVED_REF",
                  "W_FORWARD_REF_LITERALIZED",
                  "W_COMMENT_MOVED",
                  "W_COMMENT_DROPPED",
                  "E_LOCK_JSON",
                  "E_LOCK_VERSION",
                  "E_LOCK_SHAPE",
                  "E_LOCK_UNKNOWN_FIELD",
                  "E_LOCK_KEY",
                  "E_LOCK_IDENT",
                  "E_LOCK_DUPLICATE_IDENT",
                  "E_LOCK_DUPLICATE_ID",
                  "E_LOCK_PARENT",
                  "E_LOCK_BRANCH",
                  "E_LOCK_CODE_FILE_PATH",
                  "E_SOURCE_META_JSON",
                  "E_SOURCE_META_VERSION",
                  "E_SOURCE_META_SHAPE",
                  "E_SOURCE_META_UNKNOWN_FIELD",
                  "E_SOURCE_META_IDENT",
                  "E_SOURCE_META_DUPLICATE_IDENT",
                  "E_SOURCE_META_ANCHOR",
                  "E_CANON_LEGACY_NAME_COLLISION",
                  "E_CANON_EDGE_SCOPE",
                  "W_CANON_RESERVED_NAME",
                  "W_CANON_DANGLING_EDGE",
                  "W_CANON_DANGLING_PARENT",
                  "W_CANON_RAW_HANDLE",
                  "W_CANON_UNKNOWN_BLOCK_TYPE",
                  "W_CANON_UNRESOLVED_ID",
                  "W_CANON_TITLE_OVERRIDE",
                  "W_CANON_SUBFLOW_REPAIRED",
                  "W_CANON_SUBBLOCK_TYPE_DRIFT",
                  "W_CANON_UNDECODABLE_JSON",
                  "E_MAT_DUPLICATE_LOCK_ID",
                  "E_MAT_UNKNOWN_RESOURCE",
                  "E_MAT_UNKNOWN_VARIABLE",
                  "W_MAT_DELETED_SINCE_PULL",
                  "W_MAT_INFERRED_RENAME",
                  "W_MAT_RETYPE_RECREATED",
                  "W_MAT_LOCK_ID_CLAIMED",
                  "I_MAT_NEEDS_LAYOUT",
                  "E_APPLY_WORKFLOW_MISMATCH",
                  "E_APPLY_LOCKED_BLOCK",
                  "E_APPLY_TYPE_NOT_ADDABLE",
                  "E_APPLY_INVALID_STATE",
                  "E_APPLY_BLOCK_NOT_FOUND",
                  "E_APPLY_INVALID_BLOCK_TYPE",
                  "E_APPLY_BLOCK_NOT_ALLOWED",
                  "E_APPLY_MODEL_NOT_ALLOWED",
                  "E_APPLY_TOOL_NOT_ALLOWED",
                  "E_APPLY_INVALID_EDGE_SOURCE",
                  "E_APPLY_INVALID_EDGE_SCOPE",
                  "E_APPLY_INVALID_SOURCE_HANDLE",
                  "E_APPLY_INVALID_TARGET_HANDLE",
                  "E_APPLY_INVALID_SUBBLOCK_FIELD",
                  "E_APPLY_MISSING_REQUIRED_PARAMS",
                  "E_APPLY_RETRY_NOT_SUPPORTED",
                  "E_APPLY_DUPLICATE_TRIGGER",
                  "E_APPLY_DUPLICATE_SINGLE_INSTANCE_BLOCK",
                  "E_APPLY_DISABLED_ANCESTOR",
                  "E_APPLY_CREDENTIAL_UNREACHABLE",
                  "W_APPLY_CREDENTIAL_KEPT",
                  "E_APPLY_SANDBOX_PLAN_REQUIRED",
                  "W_APPLY_HOSTED_KEY_DROPPED",
                  "W_APPLY_VALUE_NORMALIZED",
                  "W_APPLY_TYPE_CHANGED",
                  "W_APPLY_TRIGGER_REMOVED",
                  "W_APPLY_CATALOG_MOVED",
                  "W_APPLY_PROBABLE_RENAME",
                  "E_APPLY_LINT",
                  "E_APPLY_UNRESOLVED_REF",
                  "E_APPLY_REF_OUT_OF_SCOPE",
                  "E_APPLY_CODE_FILE_REF_SYNTAX",
                  "E_APPLY_LOOP_CONDITION_SYNTAX",
                  "W_APPLY_LINT",
                  "W_TABLE_UNKNOWN_COLUMN",
                  "E_APPLY_INVALID_SCHEDULE",
                  "E_APPLY_BLOCK_DELETE",
                  "E_APPLY_VARIABLE_DELETE",
                  "E_WORKFLOW_META_INVALID"
                ],
                "description": "Diagnostic code."
              },
              "message": {
                "type": "string",
                "description": "What failed."
              }
            },
            "required": [
              "kind",
              "key",
              "code",
              "message"
            ],
            "additionalProperties": false
          },
          "needBlobs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Binary paths a write needs whose bytes are not staged: on a dry run, exactly what to stage before applying."
          },
          "applyId": {
            "description": "The id of an apply that wrote: every audit log entry its writes recorded carries it as `metadata.correlationId`. Absent on a dry run.",
            "type": "string"
          },
          "files": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            },
            "description": "Files re-printed from what was saved, for every resource written."
          },
          "base": {
            "type": "object",
            "properties": {
              "version": {
                "type": "number",
                "const": 1,
                "description": "Base format version."
              },
              "workspaceId": {
                "type": "string",
                "description": "Workspace the directory was read from."
              },
              "resources": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Stored id the key is bound to."
                    },
                    "fingerprint": {
                      "description": "`rf1:` fingerprint of the resource as last read; absent for a workflow, and for a binary file listed without `sha256` until the client records its hash.",
                      "type": "string"
                    },
                    "columns": {
                      "description": "Table column key → stored column.",
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Stored column id."
                          },
                          "options": {
                            "description": "Select option name → option id.",
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {
                              "type": "string"
                            }
                          }
                        },
                        "required": [
                          "id"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "blobs": {
                      "description": "Binary file name → its stored id, revision and hash as last read.",
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Stored id of the binary file."
                          },
                          "rev": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "string"
                              }
                            ],
                            "description": "Content revision as last read."
                          },
                          "sha256": {
                            "type": "string",
                            "pattern": "^[0-9a-f]{64}$",
                            "description": "SHA-256 of the bytes, lowercase hex."
                          }
                        },
                        "required": [
                          "id",
                          "rev",
                          "sha256"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "rows": {
                      "description": "A table’s managed rows, as last read.",
                      "type": "object",
                      "properties": {
                        "fingerprint": {
                          "type": "string",
                          "description": "`rf1:` fingerprint of the managed rows as last read."
                        },
                        "version": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991,
                          "description": "The table’s row version as last read; it moves on every row write."
                        }
                      },
                      "required": [
                        "fingerprint",
                        "version"
                      ],
                      "additionalProperties": {
                        "description": "An `x-` extension field, kept as written."
                      }
                    }
                  },
                  "required": [
                    "id"
                  ],
                  "additionalProperties": {
                    "description": "An `x-` extension field, kept as written."
                  },
                  "description": "One resource in the base."
                },
                "description": "`kind:key` → the stored resource and its fingerprint."
              }
            },
            "required": [
              "version",
              "workspaceId",
              "resources"
            ],
            "additionalProperties": {
              "description": "An `x-` extension field, kept as written."
            },
            "description": "The base after this apply: the next apply’s `base`."
          },
          "diagnostics": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "enum": [
                    "E_DECL_SYNTAX",
                    "E_DECL_HEADER",
                    "E_DECL_IMPORT",
                    "E_DECL_EXPORT",
                    "E_DECL_UNSUPPORTED",
                    "E_DECL_DUPLICATE_KEY",
                    "E_DECL_SHAPE",
                    "E_DECL_UNKNOWN_FIELD",
                    "E_DECL_UNKNOWN_FILE",
                    "W_PATH_NOT_SENT",
                    "E_BLOB_MANIFEST",
                    "E_BLOB_MISSING",
                    "E_KEY_INVALID",
                    "W_DECL_SUSPICIOUS_CHARACTER",
                    "E_BASE_JSON",
                    "E_BASE_VERSION",
                    "E_BASE_SHAPE",
                    "E_BASE_UNKNOWN_FIELD",
                    "E_SECRET_NAME",
                    "E_SECRET_MISSING",
                    "W_SECRET_MISSING",
                    "E_CREDENTIAL_MISSING",
                    "E_CREDENTIAL_AMBIGUOUS",
                    "W_CREDENTIAL_MISSING",
                    "W_CREDENTIAL_AMBIGUOUS",
                    "E_TABLE_COLUMN_NAME",
                    "E_TABLE_DUPLICATE_COLUMN",
                    "E_TABLE_TOO_MANY_COLUMNS",
                    "E_TABLE_OPTIONS",
                    "E_TABLE_TYPE_CONVERSION",
                    "E_TABLE_FOLDER",
                    "E_TABLE_ROWS",
                    "I_TABLE_SEED_SKIPPED",
                    "I_TABLE_ROWS_UNKEYED",
                    "W_LIKELY_RENAME",
                    "E_TOOL_SCHEMA",
                    "E_TOOL_CODE",
                    "E_TOOL_STORED_MISSING",
                    "W_TOOL_LITERAL_SECRET",
                    "E_SKILL_FRONTMATTER",
                    "E_MCP_LITERAL_SECRET",
                    "E_MCP_STORED_MISSING",
                    "E_MCP_TOOL_UNKNOWN",
                    "W_MCP_REPLACE",
                    "W_MCP_TOOLS_UNCHECKED",
                    "E_FILE_PATH",
                    "E_FILE_PATH_COLLISION",
                    "E_FILE_NAME",
                    "E_FILE_TOO_LARGE",
                    "E_FILE_CONTENT",
                    "E_KB_EMBEDDING_IMMUTABLE",
                    "E_KB_EMBEDDING_MODEL",
                    "E_KB_DOC_AMBIGUOUS",
                    "E_KB_DOC_NAME",
                    "E_KB_DOC_EMPTY",
                    "E_KB_CHUNKING",
                    "E_KB_FOLDER",
                    "W_KB_DOC_UNCHECKED",
                    "W_KB_DOC_FAILED",
                    "I_KB_REEMBED",
                    "I_KB_CHUNKING",
                    "I_KB_PROCESSING",
                    "I_KB_DOCS_UNHASHED",
                    "I_KB_UNMANAGED_DOCS",
                    "I_KB_REPLACE_UNFINISHED",
                    "E_DEPLOY_WORKFLOW",
                    "E_DEPLOY_SECRET",
                    "E_DEPLOY_CHAT_OUTPUT",
                    "E_DEPLOY_CHAT_IDENTIFIER",
                    "E_DEPLOY_PINNED_CHAT",
                    "W_DEPLOYED_DRAFT_CHANGED",
                    "W_DEPLOY_DRAFT_NOT_SOURCE",
                    "E_DEPLOY_DRAFT_NOT_SOURCE_CHAT",
                    "I_DEPLOY_DRAFT_NOT_LIVE",
                    "E_APPLY_NO_BASE",
                    "E_APPLY_FORBIDDEN",
                    "E_APPLY_DELETE_NOT_ALLOWED",
                    "E_APPLY_LOCKED",
                    "E_APPLY_REFUSED",
                    "E_APPLY_FAILED",
                    "E_PLAN_TOO_LARGE",
                    "E_PLAN_REF_DELETED",
                    "E_PLAN_REF_HELD",
                    "W_RESOURCE_IN_USE",
                    "W_TABLE_COLUMN_RENAMED_IN_USE",
                    "E_WORKFLOW_FILES_MISSING",
                    "E_WORKFLOW_FOLDER_COPIED",
                    "W_UNDECLARED",
                    "W_BASE_OTHER_WORKSPACE",
                    "W_PROMOTE_TARGET_DELETED",
                    "W_PROMOTE_DELETES_TARGET_ONLY",
                    "W_SERVER_CHANGED",
                    "W_SERVER_DELETED",
                    "W_SERVER_MOVED",
                    "I_KEY_REBOUND",
                    "E_KEY_RENAMED",
                    "E_APPLY_STALE",
                    "E_LIMIT_EXCEEDED",
                    "E_NAME_TAKEN",
                    "I_FINDINGS_TRUNCATED",
                    "E_SYNTAX",
                    "E_SDK_HEADER",
                    "E_SDK_MAJOR",
                    "E_SDK_MAJOR_OLD",
                    "E_UNSUPPORTED_SYNTAX",
                    "E_WORKFLOW_EXPORT",
                    "E_INVALID_CHARACTER",
                    "E_NUMBER_NOT_FINITE",
                    "W_NUMBER_PRECISION",
                    "E_TOO_MANY_ERRORS",
                    "E_DUPLICATE_NAME",
                    "E_RESERVED_NAME",
                    "E_KEY_OVERRIDE",
                    "E_EMPTY_NAME",
                    "E_LOOKALIKE_NAME",
                    "W_LOOKALIKE_NAME",
                    "W_SUSPICIOUS_CHARACTER",
                    "E_NAME_NOT_LITERAL",
                    "E_UNKNOWN_IDENTIFIER",
                    "E_OUT_OF_SCOPE",
                    "E_UNKNOWN_VARIABLE",
                    "E_DUPLICATE_VARIABLE",
                    "E_VARIABLE_NAME_MISMATCH",
                    "E_INVALID_ENV_NAME",
                    "W_ENV_UNKNOWN",
                    "W_CHILD_INPUT_UNKNOWN",
                    "W_CHILD_NO_START",
                    "W_CHILD_RESULT_PATH",
                    "E_UNKNOWN_SUBFLOW_PROPERTY",
                    "W_FORWARD_REF",
                    "W_REF_NOT_NORMALIZED",
                    "E_REF_UNREPRESENTABLE",
                    "W_REF_OUT_OF_SCOPE",
                    "E_EDGE_SCOPE",
                    "E_EDGE_NOTE",
                    "E_TARGET_TRIGGER",
                    "E_NO_DEFAULT_OUTPUT",
                    "E_DUPLICATE_EDGE",
                    "E_ERROR_PORT_UNSUPPORTED",
                    "W_ERROR_PORT_STORED",
                    "E_UNKNOWN_BRANCH",
                    "E_DUPLICATE_BRANCH_KEY",
                    "E_BRANCH_KEY_COLLIDES",
                    "E_BRANCH_ELSE_LAST",
                    "W_RAW_HANDLE",
                    "W_SUBFLOW_HANDLE_SCOPE",
                    "E_EDGE_CYCLE",
                    "W_EDGE_CYCLE",
                    "W_BRANCH_UNWIRED",
                    "E_UNKNOWN_BUILDER",
                    "E_UNKNOWN_PARAM",
                    "E_FIXED_PARAM",
                    "W_FIELD_NOT_APPLICABLE",
                    "W_REQUIRED_MISSING",
                    "W_UNKNOWN_OPTION",
                    "E_UNKNOWN_OPERATION",
                    "W_UNKNOWN_MODEL",
                    "W_LEGACY_BLOCK_TYPE",
                    "W_UNKNOWN_BLOCK_TYPE",
                    "W_TYPE_NOT_ADDABLE",
                    "I_SCHEDULE_UTC",
                    "E_STORED_VALUE_MISSING",
                    "W_VALUE_KIND",
                    "W_OUT_OF_RANGE",
                    "W_TABLE_FILTER_SHAPE",
                    "W_LITERAL_SECRET",
                    "W_SUBFLOW_COUNT",
                    "W_UNKNOWN_OUTPUT_PATH",
                    "W_OUTPUT_PATH_UNDECLARED",
                    "W_JSON_REF_UNTYPED",
                    "W_LOOP_CONDITION_SYNTAX",
                    "E_CODE_FILE_MISSING",
                    "E_CODE_FILE_PATH",
                    "W_CODE_FILE_INLINED",
                    "W_CODE_FILE_REF_SYNTAX",
                    "W_UNRESOLVED_REF",
                    "W_FORWARD_REF_LITERALIZED",
                    "W_COMMENT_MOVED",
                    "W_COMMENT_DROPPED",
                    "E_LOCK_JSON",
                    "E_LOCK_VERSION",
                    "E_LOCK_SHAPE",
                    "E_LOCK_UNKNOWN_FIELD",
                    "E_LOCK_KEY",
                    "E_LOCK_IDENT",
                    "E_LOCK_DUPLICATE_IDENT",
                    "E_LOCK_DUPLICATE_ID",
                    "E_LOCK_PARENT",
                    "E_LOCK_BRANCH",
                    "E_LOCK_CODE_FILE_PATH",
                    "E_SOURCE_META_JSON",
                    "E_SOURCE_META_VERSION",
                    "E_SOURCE_META_SHAPE",
                    "E_SOURCE_META_UNKNOWN_FIELD",
                    "E_SOURCE_META_IDENT",
                    "E_SOURCE_META_DUPLICATE_IDENT",
                    "E_SOURCE_META_ANCHOR",
                    "E_CANON_LEGACY_NAME_COLLISION",
                    "E_CANON_EDGE_SCOPE",
                    "W_CANON_RESERVED_NAME",
                    "W_CANON_DANGLING_EDGE",
                    "W_CANON_DANGLING_PARENT",
                    "W_CANON_RAW_HANDLE",
                    "W_CANON_UNKNOWN_BLOCK_TYPE",
                    "W_CANON_UNRESOLVED_ID",
                    "W_CANON_TITLE_OVERRIDE",
                    "W_CANON_SUBFLOW_REPAIRED",
                    "W_CANON_SUBBLOCK_TYPE_DRIFT",
                    "W_CANON_UNDECODABLE_JSON",
                    "E_MAT_DUPLICATE_LOCK_ID",
                    "E_MAT_UNKNOWN_RESOURCE",
                    "E_MAT_UNKNOWN_VARIABLE",
                    "W_MAT_DELETED_SINCE_PULL",
                    "W_MAT_INFERRED_RENAME",
                    "W_MAT_RETYPE_RECREATED",
                    "W_MAT_LOCK_ID_CLAIMED",
                    "I_MAT_NEEDS_LAYOUT",
                    "E_APPLY_WORKFLOW_MISMATCH",
                    "E_APPLY_LOCKED_BLOCK",
                    "E_APPLY_TYPE_NOT_ADDABLE",
                    "E_APPLY_INVALID_STATE",
                    "E_APPLY_BLOCK_NOT_FOUND",
                    "E_APPLY_INVALID_BLOCK_TYPE",
                    "E_APPLY_BLOCK_NOT_ALLOWED",
                    "E_APPLY_MODEL_NOT_ALLOWED",
                    "E_APPLY_TOOL_NOT_ALLOWED",
                    "E_APPLY_INVALID_EDGE_SOURCE",
                    "E_APPLY_INVALID_EDGE_SCOPE",
                    "E_APPLY_INVALID_SOURCE_HANDLE",
                    "E_APPLY_INVALID_TARGET_HANDLE",
                    "E_APPLY_INVALID_SUBBLOCK_FIELD",
                    "E_APPLY_MISSING_REQUIRED_PARAMS",
                    "E_APPLY_RETRY_NOT_SUPPORTED",
                    "E_APPLY_DUPLICATE_TRIGGER",
                    "E_APPLY_DUPLICATE_SINGLE_INSTANCE_BLOCK",
                    "E_APPLY_DISABLED_ANCESTOR",
                    "E_APPLY_CREDENTIAL_UNREACHABLE",
                    "W_APPLY_CREDENTIAL_KEPT",
                    "E_APPLY_SANDBOX_PLAN_REQUIRED",
                    "W_APPLY_HOSTED_KEY_DROPPED",
                    "W_APPLY_VALUE_NORMALIZED",
                    "W_APPLY_TYPE_CHANGED",
                    "W_APPLY_TRIGGER_REMOVED",
                    "W_APPLY_CATALOG_MOVED",
                    "W_APPLY_PROBABLE_RENAME",
                    "E_APPLY_LINT",
                    "E_APPLY_UNRESOLVED_REF",
                    "E_APPLY_REF_OUT_OF_SCOPE",
                    "E_APPLY_CODE_FILE_REF_SYNTAX",
                    "E_APPLY_LOOP_CONDITION_SYNTAX",
                    "W_APPLY_LINT",
                    "W_TABLE_UNKNOWN_COLUMN",
                    "E_APPLY_INVALID_SCHEDULE",
                    "E_APPLY_BLOCK_DELETE",
                    "E_APPLY_VARIABLE_DELETE",
                    "E_WORKFLOW_META_INVALID"
                  ],
                  "description": "Diagnostic code, e.g. `E_APPLY_STALE` or `E_UNKNOWN_PARAM`."
                },
                "severity": {
                  "type": "string",
                  "enum": [
                    "error",
                    "warning",
                    "info"
                  ],
                  "description": "Diagnostic severity."
                },
                "message": {
                  "type": "string",
                  "description": "What was found."
                },
                "hint": {
                  "description": "How to address it.",
                  "type": "string"
                },
                "file": {
                  "description": "Directory file the finding is in.",
                  "type": "string"
                },
                "line": {
                  "description": "1-based line in `file`.",
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "column": {
                  "description": "1-based column in `file`.",
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "endLine": {
                  "description": "1-based line the finding ends on.",
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "endColumn": {
                  "description": "1-based column the finding ends at.",
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "frame": {
                  "description": "The source lines around the finding, with a caret row.",
                  "type": "string"
                },
                "path": {
                  "description": "JSON Pointer into a JSON file, such as the base.",
                  "type": "string"
                },
                "kind": {
                  "description": "Kind of the resource the finding is about.",
                  "type": "string"
                },
                "key": {
                  "description": "Key of the resource the finding is about.",
                  "type": "string"
                },
                "blockKey": {
                  "description": "Workflow block the finding is about.",
                  "type": "string"
                },
                "param": {
                  "description": "Block field the finding is about.",
                  "type": "string"
                }
              },
              "required": [
                "code",
                "severity",
                "message"
              ],
              "additionalProperties": false,
              "description": "A finding about the directory, pinned to its file when it has one."
            },
            "description": "Warnings, and on a dry run every error."
          }
        },
        "required": [
          "workspaceId",
          "dryRun",
          "plan",
          "applied",
          "needBlobs",
          "files",
          "base",
          "diagnostics"
        ],
        "additionalProperties": false,
        "description": "Response data."
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false,
    "title": "Apply workspace source response",
    "description": "The plan, what was written, and the files re-printed from it.",
    "examples": [
      {
        "data": {
          "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64",
          "dryRun": false,
          "plan": [
            {
              "kind": "table",
              "key": "leads",
              "action": "noop",
              "id": "tbl_5c0e2a7b9d1f4e3a8b6c2d0f7e9a1b3c"
            }
          ],
          "applied": [],
          "needBlobs": [],
          "files": {},
          "base": {
            "version": 1,
            "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64",
            "resources": {
              "table:leads": {
                "id": "tbl_5c0e2a7b9d1f4e3a8b6c2d0f7e9a1b3c",
                "fingerprint": "rf1:4b8d2f6a0c3e7b1d5f9a2c6e0b4d8f3a7c1e5b9d2f6a0c4e8b3d7f1a5c9e2b6d",
                "columns": {
                  "email": {
                    "id": "col_8e1c4a7b2d5f"
                  },
                  "status": {
                    "id": "col_3b6d9f2a5c8e",
                    "options": {
                      "new": "k2Pq9x",
                      "won": "r7Tn4m"
                    }
                  }
                }
              }
            }
          },
          "diagnostics": []
        }
      }
    ]
  },
  "#/components/responses/BadRequest": {
    "description": "The request is invalid. This includes a query parameter sent with no value (`?limit=`, `?search=`), which is rejected rather than read as zero, empty, or the parameter default — omit the parameter instead.",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/V2Error"
        },
        "example": {
          "error": {
            "code": "BAD_REQUEST",
            "message": "Invalid request"
          }
        }
      }
    }
  },
  "#/components/schemas/V2Error": {
    "type": "object",
    "properties": {
      "error": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Stable machine-readable error code."
          },
          "message": {
            "type": "string",
            "description": "Human-readable explanation of the error."
          },
          "details": {
            "description": "Structured error context whose keys depend on the error. Actionable `403` responses use the `V2ActionableForbiddenDetails` shape; validation failures may return issue arrays instead.",
            "anyOf": [
              {
                "$ref": "#/components/schemas/V2ActionableForbiddenDetails"
              },
              {
                "description": "Other structured context defined by the specific error."
              }
            ]
          },
          "requestId": {
            "description": "Identifier of this request, the same id as the `x-request-id` response header. Quote it when contacting support.",
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "additionalProperties": false,
        "description": "Canonical error details."
      }
    },
    "required": [
      "error"
    ],
    "additionalProperties": false,
    "title": "v2 error response",
    "description": "Canonical error envelope returned by the public v2 API.",
    "examples": [
      {
        "error": {
          "code": "BAD_REQUEST",
          "message": "The request is invalid."
        }
      }
    ]
  },
  "#/components/schemas/V2ActionableForbiddenDetails": {
    "type": "object",
    "properties": {
      "code": {
        "$ref": "#/components/schemas/V2ForbiddenDetailCode"
      }
    },
    "required": [
      "code"
    ],
    "additionalProperties": {
      "description": "Additional context for this refusal."
    },
    "title": "Actionable forbidden details",
    "description": "Machine-readable cause and optional context for an actionable `403` response."
  },
  "#/components/schemas/V2ForbiddenDetailCode": {
    "type": "string",
    "enum": [
      "INSUFFICIENT_WORKSPACE_ROLE",
      "PERSONAL_API_KEYS_DISABLED",
      "WORKSPACE_KEY_OPERATION_NOT_PERMITTED",
      "PRINCIPAL_KIND_NOT_PERMITTED",
      "ORGANIZATION_MEMBERSHIP_REQUIRED",
      "ORGANIZATION_ADMIN_REQUIRED",
      "ENTERPRISE_PLAN_REQUIRED",
      "SSO_DISABLED",
      "SSO_DOMAIN_NOT_VERIFIED",
      "SSO_PROVIDER_LIMIT_REACHED",
      "ORGANIZATION_PLAN_REQUIRED",
      "AUDIT_LOGS_DISABLED",
      "ACCESS_REQUESTS_DISABLED",
      "ACCESS_REQUEST_ORGANIZATION_REQUIRED",
      "SKILL_EDITOR_ACCESS_REQUIRED",
      "SECRET_ADMIN_ACCESS_REQUIRED",
      "WORKSPACE_RESOURCE_LIMIT_REACHED",
      "PUBLIC_SHARING_NOT_ALLOWED",
      "CREDENTIAL_ADMIN_ACCESS_REQUIRED",
      "MCP_SERVER_URL_NOT_ALLOWED",
      "WORKSPACE_PLAN_CAPABILITY_REQUIRED",
      "CHAT_AUTH_MODE_NOT_PERMITTED",
      "CONNECTOR_MANAGED_RESOURCE_READ_ONLY",
      "PERMISSION_GROUP_CAPABILITY_BLOCKED",
      "INTEGRATION_NOT_ALLOWED",
      "INSUFFICIENT_SCOPE",
      "READ_ONLY_API_KEY",
      "SCIM_MANAGED_MEMBERSHIP",
      "FEATURE_NOT_ENABLED"
    ],
    "title": "Forbidden detail code",
    "description": "Stable cause code for an actionable `403` response."
  },
  "#/components/responses/Unauthorized": {
    "description": "The API credential is missing or invalid.",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/V2Error"
        },
        "example": {
          "error": {
            "code": "UNAUTHORIZED",
            "message": "Authentication required"
          }
        }
      }
    }
  },
  "#/components/responses/Forbidden": {
    "description": "The caller lacks the rights this operation requires. When the cause is one a caller can act on, `error.details.code` names it. A resource in a workspace the caller cannot reach at all answers `404` instead, so absence and denial are indistinguishable.",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/V2Error"
        },
        "example": {
          "error": {
            "code": "FORBIDDEN",
            "message": "Insufficient workspace permissions",
            "details": {
              "code": "INSUFFICIENT_WORKSPACE_ROLE"
            }
          }
        }
      }
    }
  },
  "#/components/responses/NotFound": {
    "description": "The requested resource was not found.",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/V2Error"
        },
        "example": {
          "error": {
            "code": "NOT_FOUND",
            "message": "Not found"
          }
        }
      }
    }
  },
  "#/components/responses/Conflict": {
    "description": "The request conflicts with current resource state.",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/V2Error"
        },
        "example": {
          "error": {
            "code": "CONFLICT",
            "message": "The request conflicts with current resource state"
          }
        }
      }
    }
  },
  "#/components/responses/PayloadTooLarge": {
    "description": "The request, or a resource collection it must materialize, exceeds the allowed size: an oversized request body, a generated artifact past the download ceiling, or a workspace folder tree too large to load in full.",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/V2Error"
        },
        "example": {
          "error": {
            "code": "PAYLOAD_TOO_LARGE",
            "message": "Request body is too large"
          }
        }
      }
    }
  },
  "#/components/responses/UnsupportedMediaType": {
    "description": "The request uses an unsupported media type.",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/V2Error"
        },
        "example": {
          "error": {
            "code": "UNSUPPORTED_MEDIA_TYPE",
            "message": "Request body must be sent as application/json"
          }
        }
      }
    }
  },
  "#/components/responses/Locked": {
    "description": "The resource is temporarily locked or unavailable; retry the request.",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/V2Error"
        },
        "example": {
          "error": {
            "code": "LOCKED",
            "message": "Workflow is locked"
          }
        }
      }
    }
  },
  "#/components/responses/RateLimited": {
    "description": "The caller exceeded the request rate limit.",
    "headers": {
      "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
      }
    },
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/V2Error"
        },
        "example": {
          "error": {
            "code": "RATE_LIMITED",
            "message": "API rate limit exceeded",
            "details": {
              "retryAfter": "2026-01-01T00:00:30.000Z"
            }
          }
        }
      }
    }
  },
  "#/components/headers/Retry-After": {
    "description": "Seconds to wait before retrying, sent on `429` and `503`. Add jitter rather than retrying at exactly this offset.",
    "schema": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991,
      "title": "Retry after",
      "description": "Seconds to wait before retrying, sent on `429` and `503`. Add jitter rather than retrying at exactly this offset."
    }
  },
  "#/components/responses/InternalError": {
    "description": "An unexpected server error occurred.",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/V2Error"
        },
        "example": {
          "error": {
            "code": "INTERNAL_ERROR",
            "message": "Internal server error"
          }
        }
      }
    }
  },
  "#/components/responses/ServiceUnavailable": {
    "description": "A required service is temporarily unavailable. When present, `Retry-After` gives the minimum seconds to wait; add jitter before retrying. Check operation-specific guidance before repeating a change after an uncertain response.",
    "headers": {
      "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
      }
    },
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/V2Error"
        },
        "example": {
          "error": {
            "code": "SERVICE_UNAVAILABLE",
            "message": "Service temporarily unavailable"
          }
        }
      }
    }
  }
}

```

[Download OpenAPI specification](/openapi.json)

Source: `openapi-v2-workflows.json`, operation `applyWorkspaceSource`.