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

# Apply secrets to many computers

> Write vault secrets onto every computer in a workspace, or a list of computers, in one call. Take them off, or preview what either would change.

Applies vault secrets to many running Linux computers in one call. With `remove: true` it takes them off instead, and with `dry_run: true` it changes nothing and says what each computer would get. Each computer gets what [Apply secrets to a computer](https://docs.orgo.ai/api-reference/computers/sync-secrets.md) gives it: the same files, the same agent env files, and the same `report`. Values are never returned.

> [!NOTE]
>
> This call never wakes a computer. A computer that is asleep, in storage or on its host, is listed as `not_changed`. Start or wake it, then send its id again.

## Body parameters

**names** `string[]` *required*

1 to 50 environment variable names from your vault: letters, digits, and underscores, not starting with a digit, up to 64 characters each. Duplicates are ignored. `ORGO_API_KEY` returns `422`.

**computer\_ids** `string[] | null`

1 to 100 computers, each a computer UUID or `instance_id`. Orgo sends to exactly these computers. Duplicates are ignored. `null` is the same as leaving it out.

**workspace\_id** `string | null`

A workspace UUID, in lowercase as Orgo returns it. Without `computer_ids`, every computer in this workspace is in scope. With `computer_ids`, it does not choose computers, but it must still be a workspace you can change. Any other string, an id in capitals included, returns `403`. `null` is the same as leaving it out.

**remove** `boolean` (default: false)

`true` takes the names off the computers instead of writing them, as described in [Remove secrets from a computer](https://docs.orgo.ai/api-reference/computers/sync-secrets.md#remove-secrets-from-a-computer).

**dry\_run** `boolean` (default: false)

`true` changes nothing. Each computer answers what an apply, or with `remove: true` a removal, would change there, as described in [Preview what would change](https://docs.orgo.ai/api-reference/computers/sync-secrets.md#preview-what-would-change).

`remove` and `dry_run` are each `true`, `false`, or left out. Any other value returns `400`. Fields this endpoint does not take, such as `wake`, are ignored.

## Which computers

| You send | Computers in scope |
| - | - |
| `computer_ids` | Exactly those. A computer you can't reach or can't change is a `failed` or `not_changed` result, not a refusal of the whole call. |
| `workspace_id` | Every computer in that workspace. Running Linux computers get every name. The rest are `not_changed`, with why. |
| Neither | The computers where each name is saved, described below. |

With neither, each name goes where it is saved:

* An account secret goes to every workspace you own.
* A secret saved only for a workspace goes to that workspace, whoever owns it.
* A workspace someone else owns does not get account secrets, because its other members, and the agents they talk to, could read what you send. Name it in `workspace_id`, or its computers in `computer_ids`, to include it. Unless every name you send that has an account value also has its own value saved for that workspace, none of those names go there, not even the workspace's own values. Names saved only for that workspace still go there. When nothing goes there, its running computers are listed as `not_changed`, with how to include them.
* With `remove: true`, an account secret is taken off every workspace you own, except where a workspace has its own secret with that name. Its computers got the workspace's value, so the name stays there. When that leaves nothing to remove in a workspace, its computers are listed as `not_changed`.
* A removal leaves out a workspace someone else owns in the same way, because it takes the name off whatever its value, so it would also take another member's value of that name. Name the workspace or its computers to include it. A secret saved only for that workspace is still taken off there.
* A workspace you can only view is never changed. When a secret saved only for that workspace names it, its computers are listed as `not_changed`, saying you can only view it. Otherwise it is not listed.
* Client workspaces you created under Invoicing are left out. Name them in `workspace_id` or `computer_ids`.
* A name that is in none of your vaults returns `404` with `code: "secret_not_found"`.

Where a workspace has its own value for a name and Orgo sends that name there, its computers get that value rather than the account's.

## How the call runs

Orgo works on four computers at a time, and never wakes one. A computer whose secrets are too large to send in one call is sent them in halves. No computer starts after 45 seconds, and a computer sent its secrets in halves starts no next half after that. Computers already under way finish, so the answer can take longer than 45 seconds. Orgo starts no step on a computer that could still be running 90 seconds into the call. A removal leaves out its second step on `/root/.env` when time is short, and that computer's `report` says the line stays.

The computers that did not start are in `remaining`, and `next` holds the calls that finish the job.

## Response

**dry\_run** `boolean`

Whether this was a preview.

**names** `string[]`

The names sent, without duplicates.

**results** `object[]`

One entry per computer, in the order of the computers in scope, followed by the computers found `not_changed` while choosing them.

**properties**

**computer\_id** `string`

The computer's UUID when Orgo could read the computer, else the id as you sent it.

**name** `string | null`

The computer's name. `null` when it is not known, such as for a computer that was not found.

**workspace\_id** `string | null`

The computer's workspace. `null` when it is not known.

**outcome** `string`

`applied`, `removed`, `previewed`, `not_changed`, or `failed`.

**reason** `string`

On `not_changed` and `failed`: why, as a sentence you can show people.

**report** `object | null`

On `applied`, `removed`, and `previewed`: what the computer reported, described in [The report](https://docs.orgo.ai/api-reference/computers/sync-secrets.md#the-report). `null` when no report came back.

**remaining** `string[]`

The computers that did not start before the time ran out: the ids as you sent them in `computer_ids`, or computer UUIDs otherwise. Empty when every computer ran.

**next** `object[]`

The calls that finish the job: the computers in `remaining`, each call with the names those computers were due. Send each one to this endpoint as it is. Empty when `remaining` is.

**properties**

**names** `string[]`

The names these computers were due. With neither `computer_ids` nor `workspace_id`, a workspace can be due fewer names than you sent.

**computer\_ids** `string[]`

Up to 100 of the computers in `remaining`.

**remove** `boolean`

`true` when this call was a removal. Left out otherwise.

**dry\_run** `boolean`

`true` when this call was a preview. Left out otherwise.

The answer carries `Cache-Control: no-store`.

### Outcomes

| `outcome` | Meaning |
| - | - |
| `applied` | The names were written. `report` says what each agent got. |
| `removed` | The removal ran. `report.names` says, for each name, whether a copy was taken out or stays. |
| `previewed` | `dry_run: true`. Nothing changed, and `report` says what would. |
| `not_changed` | The computer was not sent to, or answered that it can't be changed now. `reason` says why. |
| `failed` | The computer could not be changed. `reason` says why. |

Common reasons:

| `outcome` | `reason` | When |
| - | - | - |
| `failed` | `Computer not found.` | No such computer, or one you are not a member of. The two read the same, so the answer does not tell which ids exist. |
| `failed` | `You can view this workspace but not change its computers.` | You can only view the computer's workspace, and you named it in `computer_ids`. |
| `failed` | `A requested secret is not available in your vault for this workspace.` | A name is not in your vault for the computer's workspace. Apply and its preview only. |
| `failed` | `Could not apply secrets. Check the computer connection and try again.` | The computer did not answer. It says `remove` for a removal and `check` for a preview. |
| `failed` | `This computer’s secrets file could not be read, so nothing was changed.` | `/root/.orgo-secrets.json` on the computer does not parse. |
| `failed` | `These secrets are too large to apply in one request. Apply fewer at a time.` | One name's value alone is too large to send to the computer. |
| `failed` | `Couldn’t check this computer. Try again.` | Orgo could not look the computer up. |
| `failed` | Why Orgo refused the computer, such as `Choose a plan to continue.` | The computer's trial or payment has lapsed, or Orgo locked it. |
| `not_changed` | `Asleep. Not changed.` | The computer is suspended, in storage or on its host, or went to sleep while Orgo reached it. Start or wake it, then send its id again. |
| `not_changed` | `Stopped. Not changed.`, `Not reachable. Not changed.`, or `Not running. Not changed.` | The computer was not running when Orgo chose the computers. |
| `not_changed` | `Start the computer before applying secrets.` | A computer you named in `computer_ids` is not running, or is suspended on its host. |
| `not_changed` | `Windows computers can’t get secrets yet.` (or Mac, Android, iPhone, or `This kind of computers can’t get secrets yet.` for any other system) | Only Linux computers get secrets. |
| `not_changed` | `Applying secrets currently requires a Linux computer.` | A computer you named in `computer_ids` is not a Linux computer. |
| `not_changed` | `Someone else owns this workspace. Name it in workspace_id or computer_ids to include it.` | The default scope left out a workspace someone else owns. |
| `not_changed` | `This workspace has its own value. Not changed.` | A removal with the default scope left out a workspace with its own secret of that name. |
| `not_changed` | `You can view this workspace but not change its computers.` | The default scope found a secret saved for a workspace you can only view. |

## Continue with remaining

When `remaining` is not empty, send each body in `next` to this endpoint as it is, and do the same with each answer until `next` is empty. Running the same apply on a computer twice is safe: the values are merged, not added twice.

Each body in `next` names the computers in `computer_ids`, up to 100 a call, which is the most `computer_ids` takes. Its `names` are what those computers were due. With the default scope that can be fewer than you sent: a workspace with its own value for a name keeps it on a removal, and a secret saved for one workspace goes to that workspace only. Sending every name to those computers instead fails where a name is not in your vault for the computer's workspace, and a removal would take off a name the workspace keeps its own value for.

## Errors

| Status | `code` | When |
| - | - | - |
| `400` | none | The body is not valid: `names must contain 1 to 50 environment variable names (letters, numbers, underscores; no leading number). computer_ids holds 1 to 100 computer ids, workspace_id is a workspace id, and remove and dry_run are true or false.` A `workspace_id` that is not a string returns this too. |
| `401` | none | No usable credential. |
| `401`, `403` | `key_expired`, `key_permission`, `computer_key`, `computer_scope`, and others | The key itself was refused before the call ran. A restricted key needs Secrets write. A computer's own key and a key for one computer can't call this endpoint. Listed in [Codes any endpoint can return to a key](https://docs.orgo.ai/api-reference/api-keys/manage.md#codes-any-endpoint-can-return-to-a-key). |
| `403` | `workspace_scope_mismatch` | A key scoped to one workspace: `This endpoint requires an account-wide credential (workspace_scope_mismatch).` Use a key for your whole account. |
| `403` | none | `workspace_id` is not the id of a workspace you are a member of, such as a string that is not a UUID or a UUID in capitals: `You do not have access to this workspace.` |
| `403` | `workspace_read_only` | `workspace_id` names a workspace you can only view: `This workspace is view-only. Ask the owner for write access (workspace_read_only).` |
| `404` | `secret_not_found` | With neither `computer_ids` nor `workspace_id`, a name is in none of your vaults: `NAME is not in your vault.` For a removal: `NAME is not in your vault, so Orgo can’t tell which computers have it. Name them in computer_ids, or a workspace in workspace_id.` |
| `422` | `reserved_name` | A name is `ORGO_API_KEY`: `ORGO_API_KEY is each computer’s own key. Orgo sets it, so it can’t be applied or removed here.` |
| `500` | none | An unexpected failure, such as a database error while Orgo chooses the computers: `Could not apply secrets. Try again.`, `Could not remove secrets. Try again.`, or for a preview `Could not check your computers. Try again.` |
| `503` | none | Orgo could not verify the credential because of a server-side fault: `Service temporarily unavailable. …`, with `Retry-After: 5`. Retry after that delay; do not rotate the key. |

A refusal for one computer never fails the call. It is that computer's `failed` or `not_changed` result.

## Example

The cURL call previews what applying `ANTHROPIC_API_KEY` would change on every computer in a workspace. The Python one applies it, then sends each body in `next` until every computer has run. Set `$WORKSPACE_ID` to the workspace's id.

```bash cURL theme={null}
curl -X POST https://www.orgo.ai/api/secrets/apply \
  -H "Authorization: Bearer $ORGO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"names": ["ANTHROPIC_API_KEY"], "workspace_id": "'"$WORKSPACE_ID"'", "dry_run": true}'
```

```python Python theme={null}
import os
import requests

url = "https://www.orgo.ai/api/secrets/apply"
headers = {"Authorization": f"Bearer {os.environ['ORGO_API_KEY']}"}

# Apply to every computer in the workspace, then to any the time ran out for.
calls = [{"names": ["ANTHROPIC_API_KEY"], "workspace_id": os.environ["WORKSPACE_ID"]}]
while calls:
    response = requests.post(url, headers=headers, json=calls.pop(0))
    response.raise_for_status()
    answer = response.json()
    for result in answer["results"]:
        print(result["name"], result["outcome"], result.get("reason", ""))
    calls.extend(answer["next"])
```

### Response

```json theme={null}
{
  "dry_run": true,
  "names": ["ANTHROPIC_API_KEY"],
  "results": [
    {
      "computer_id": "a3bb189e-8bf9-3888-9912-ace4e6543002",
      "name": "agent-1",
      "workspace_id": "6f1c2e7a-4b9d-4e2f-9a51-0c3d8e7b2f10",
      "outcome": "previewed",
      "report": {
        "ok": true,
        "targets": [
          { "id": "hermes", "status": "would_update", "names": ["ANTHROPIC_API_KEY"] },
          { "id": "openclaw", "status": "would_update", "names": ["ANTHROPIC_API_KEY"], "restart": "openclaw-gateway" },
          { "id": "claude-code", "status": "shell" }
        ]
      }
    },
    {
      "computer_id": "c41f7a2e-1d3b-4c8e-b6a9-5e2d0f9c7b31",
      "name": "agent-2",
      "workspace_id": "6f1c2e7a-4b9d-4e2f-9a51-0c3d8e7b2f10",
      "outcome": "not_changed",
      "reason": "Asleep. Not changed."
    }
  ],
  "remaining": [],
  "next": []
}
```


## OpenAPI

````yaml POST /secrets/apply
openapi: 3.1.0
info:
  title: Orgo API
  description: >-
    Launch cloud computers that AI agents can control and interact with. Create
    workspaces, provision computers, and control them programmatically.
  version: 2.0.0
  contact:
    name: Orgo Support
    email: contact@orgo.ai
    url: https://orgo.ai
servers:
  - url: https://www.orgo.ai/api
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Support
    description: >-
      Orgo’s support agent, for programs: ask how to do something in Orgo and
      get an answer with full URLs and copyable commands.
  - name: Account
    description: >-
      Account capacity: how many computers an account may run, and adding or
      giving back more.
  - name: Agent accounts
    description: >-
      Accounts an AI agent makes for itself, and the claim link a person uses to
      take one over.
  - name: Clients
    description: >-
      Run Orgo for your clients from your own app: a workspace and scoped key
      each, billed to you or to them.
  - name: Workspaces
    description: Organize computers into named workspaces
  - name: Computers
    description: Provision and manage virtual computers
  - name: Computer Lifecycle
    description: Start, stop, and restart computers
  - name: Computer Actions
    description: Control mouse, keyboard, and execute commands
  - name: Screens
    description: >-
      More than one desktop on a single computer. Each screen is its own X
      server with its own cursor and window manager, so an agent working on one
      cannot disturb another.
  - name: Files
    description: Upload and download files
  - name: Templates
    description: Author, build, and launch reproducible computers from templates
  - name: Chat
    description: Run an agent on a computer through OpenAI-compatible chat completions.
paths:
  /secrets/apply:
    post:
      tags:
        - Computers
      summary: Apply secrets to many computers
      description: >-
        Applies vault secrets to many running Linux computers in one call, takes
        them off with `remove: true`, or answers what either would change with
        `dry_run: true`. With `computer_ids`: exactly those computers. With
        `workspace_id`: every computer in that workspace. With neither: each
        name where it is saved, a workspace secret to its workspace and an
        account secret to every workspace you own. A workspace someone else owns
        gets account secrets, or loses them on a removal, only when named. Each
        computer gets what `POST /computers/{id}/secrets/sync` gives it. Four
        computers at a time. Never wakes a computer. No computer starts after 45
        seconds, and no step on a computer starts that could still be running 90
        seconds in. The computers that did not start are in `remaining`, and
        `next` holds the calls that finish the job, each ready to send as it is.
        A computer that can't be changed is a `failed` or `not_changed` result,
        never a refusal of the whole call. Values are never returned.
      operationId: applySecretsToComputers
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - names
              properties:
                names:
                  type: array
                  minItems: 1
                  maxItems: 50
                  items:
                    type: string
                    pattern: ^[A-Za-z_][A-Za-z0-9_]{0,63}$
                    description: >-
                      An environment variable name: letters, digits, and
                      underscores, not starting with a digit, up to 64
                      characters.
                  description: >-
                    The vault names to apply, remove, or preview. Duplicates are
                    ignored. `ORGO_API_KEY` answers `422`.
                computer_ids:
                  type:
                    - array
                    - 'null'
                  minItems: 1
                  maxItems: 100
                  items:
                    type: string
                    pattern: ^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$
                    description: A computer UUID or `instance_id`.
                  description: >-
                    Exactly these computers. Duplicates are ignored. `null` is
                    the same as leaving it out.
                workspace_id:
                  type:
                    - string
                    - 'null'
                  format: uuid
                  description: >-
                    Without `computer_ids`: every computer in this workspace.
                    With `computer_ids` it does not choose computers, but it
                    must still be a workspace you can change. A string that is
                    not the id of a workspace you are a member of, a UUID in
                    capitals included, answers `403`. `null` is the same as
                    leaving it out.
                remove:
                  type: boolean
                  default: false
                  description: >-
                    `true` takes the names off the computers instead of writing
                    them.
                dry_run:
                  type: boolean
                  default: false
                  description: >-
                    `true` changes nothing. Each computer answers what an apply,
                    or with `remove: true` a removal, would change there.
            examples:
              default:
                summary: Where Settings would apply
                value:
                  names:
                    - ANTHROPIC_API_KEY
              workspace:
                summary: Every computer in a workspace
                value:
                  names:
                    - ANTHROPIC_API_KEY
                  workspace_id: 6f1c2e7a-4b9d-4e2f-9a51-0c3d8e7b2f10
              computers-preview:
                summary: Preview on chosen computers
                value:
                  names:
                    - ANTHROPIC_API_KEY
                  computer_ids:
                    - a3bb189e-8bf9-3888-9912-ace4e6543002
                    - c41f7a2e-1d3b-4c8e-b6a9-5e2d0f9c7b31
                  dry_run: true
              remove:
                summary: Remove
                value:
                  names:
                    - ANTHROPIC_API_KEY
                  remove: true
      responses:
        '200':
          description: >-
            Each computer's outcome. The answer carries `Cache-Control:
            no-store`.
          content:
            application/json:
              schema:
                type: object
                required:
                  - dry_run
                  - names
                  - results
                  - remaining
                  - next
                properties:
                  dry_run:
                    type: boolean
                  names:
                    type: array
                    items:
                      type: string
                    description: The names sent, without duplicates.
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/SecretsApplyResult'
                    description: >-
                      One entry per computer, in the order of the computers in
                      scope, followed by the computers found `not_changed` while
                      choosing them.
                  remaining:
                    type: array
                    items:
                      type: string
                    description: >-
                      The computers that did not start before the time ran out:
                      the ids as sent in `computer_ids`, or computer UUIDs
                      otherwise. `next` holds the calls that finish them.
                  next:
                    type: array
                    description: >-
                      The calls that finish the job: the computers in
                      `remaining`, grouped by the names each was due, up to 100
                      a call. Send each one to this endpoint as it is. With
                      neither `computer_ids` nor `workspace_id`, a workspace can
                      be due fewer names than were sent. Empty when `remaining`
                      is.
                    items:
                      type: object
                      required:
                        - names
                        - computer_ids
                      properties:
                        names:
                          type: array
                          items:
                            type: string
                          description: The names these computers were due.
                        computer_ids:
                          type: array
                          minItems: 1
                          maxItems: 100
                          items:
                            type: string
                          description: Up to 100 of the computers in `remaining`.
                        remove:
                          type: boolean
                          enum:
                            - true
                          description: Present, `true`, when the call was a removal.
                        dry_run:
                          type: boolean
                          enum:
                            - true
                          description: Present, `true`, when the call was a preview.
              example:
                dry_run: false
                names:
                  - ANTHROPIC_API_KEY
                results:
                  - computer_id: a3bb189e-8bf9-3888-9912-ace4e6543002
                    name: agent-1
                    workspace_id: 6f1c2e7a-4b9d-4e2f-9a51-0c3d8e7b2f10
                    outcome: applied
                    report:
                      ok: true
                      targets:
                        - id: hermes
                          status: updated
                          names:
                            - ANTHROPIC_API_KEY
                        - id: claude-code
                          status: shell
                  - computer_id: c41f7a2e-1d3b-4c8e-b6a9-5e2d0f9c7b31
                    name: agent-2
                    workspace_id: 6f1c2e7a-4b9d-4e2f-9a51-0c3d8e7b2f10
                    outcome: not_changed
                    reason: Asleep. Not changed.
                remaining: []
                next: []
        '400':
          description: >-
            `names` is not a list of 1 to 50 valid environment variable names,
            `computer_ids` is not a list of 1 to 100 computer ids,
            `workspace_id` is not a string, or is empty, or `remove` or
            `dry_run` is not a boolean.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: >-
                  names must contain 1 to 50 environment variable names
                  (letters, numbers, underscores; no leading number).
                  computer_ids holds 1 to 100 computer ids, workspace_id is a
                  workspace id, and remove and dry_run are true or false.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: >-
            The key may not call this endpoint: a restricted key without Secrets
            write (`key_permission`), a computer's own key (`computer_key`), a
            key for one computer (`computer_scope`), or a key scoped to one
            workspace (`workspace_scope_mismatch`). Or `workspace_id` is not the
            id of a workspace you are a member of (a string that is not a UUID,
            or a UUID in capitals, included), or names one you can only view
            (`workspace_read_only`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                workspace-key:
                  summary: The API key is workspace-scoped
                  value:
                    error: >-
                      This endpoint requires an account-wide credential
                      (workspace_scope_mismatch).
                    code: workspace_scope_mismatch
                no-access:
                  summary: Not a member of workspace_id
                  value:
                    error: You do not have access to this workspace.
                view-only:
                  summary: workspace_id is view only
                  value:
                    error: >-
                      This workspace is view-only. Ask the owner for write
                      access (workspace_read_only).
                    code: workspace_read_only
        '404':
          description: >-
            With neither `computer_ids` nor `workspace_id`, a name is in none of
            your vaults.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                apply:
                  summary: Apply
                  value:
                    error: ANTHROPIC_API_KEY is not in your vault.
                    code: secret_not_found
                remove:
                  summary: Remove
                  value:
                    error: >-
                      ANTHROPIC_API_KEY is not in your vault, so Orgo can’t tell
                      which computers have it. Name them in computer_ids, or a
                      workspace in workspace_id.
                    code: secret_not_found
        '422':
          description: A name is `ORGO_API_KEY`, which holds each computer's own key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: >-
                  ORGO_API_KEY is each computer’s own key. Orgo sets it, so it
                  can’t be applied or removed here.
                code: reserved_name
        '500':
          description: >-
            An unexpected failure, such as a database error while Orgo chooses
            the computers.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                apply:
                  summary: Apply
                  value:
                    error: Could not apply secrets. Try again.
                remove:
                  summary: Remove
                  value:
                    error: Could not remove secrets. Try again.
                preview:
                  summary: Preview
                  value:
                    error: Could not check your computers. Try again.
        '503':
          $ref: '#/components/responses/AuthUnavailable'
components:
  schemas:
    SecretsApplyResult:
      type: object
      required:
        - computer_id
        - name
        - workspace_id
        - outcome
      properties:
        computer_id:
          type: string
          description: >-
            The computer's UUID when Orgo could read the computer, else the id
            as you sent it.
        name:
          type:
            - string
            - 'null'
          description: >-
            The computer's name. `null` when it is not known, such as for a
            computer that was not found.
        workspace_id:
          type:
            - string
            - 'null'
          description: The computer's workspace. `null` when it is not known.
        outcome:
          type: string
          enum:
            - applied
            - removed
            - previewed
            - not_changed
            - failed
        reason:
          type: string
          description: >-
            On `not_changed` and `failed`: why, as a sentence you can show
            people, such as `Asleep. Not changed.` or `Computer not found.`
        report:
          $ref: '#/components/schemas/SecretsReport'
          description: >-
            On `applied`, `removed`, and `previewed`: what the computer
            reported. `null` when no report came back.
    Error:
      type: object
      description: >-
        The base error body. Every failure carries `error`; individual endpoints
        add the fields named in the schemas below.
      required:
        - error
      properties:
        error:
          type: string
          description: Human-readable message.
          example: Access denied
        code:
          type: string
          description: >-
            Machine-readable reason. Present on the failures that define one,
            absent otherwise.
    SecretsReport:
      type:
        - object
        - 'null'
      description: >-
        What happened, or would happen, to each agent's env file on the
        computer. Names, ids and statuses only, never a value. `null` when no
        report line came back from the computer.
      properties:
        ok:
          type: boolean
        targets:
          type: array
          items:
            $ref: '#/components/schemas/SecretsReportTarget'
        names:
          type: object
          additionalProperties:
            type: string
            enum:
              - cleared
              - kept
              - none
              - would_clear
              - would_keep
          description: >-
            A removal, or its preview: what happened to each name on this
            computer. `cleared` when at least one copy was taken out, `kept`
            when a copy stays and none was taken out, `none` when there was no
            copy. A preview says `would_clear` and `would_keep`. `kept_in` says
            where a copy stays.
        kept_in:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: >-
            A removal, or its preview: where a copy of a name stays. `dotenv` is
            a line in `/root/.env` from when the computer was created that does
            not hold your current vault value. An agent id is a line in that
            agent's file that was changed on the computer, or a file Orgo could
            not read or write.
    SecretsReportTarget:
      type: object
      description: >-
        One agent the call reached, or would reach. Agents that are not
        installed are left out.
      required:
        - id
        - status
      properties:
        id:
          type: string
          description: >-
            The agent: `hermes`, `openclaw`, `codex`, `claude-code`, `opencode`,
            or `agy`. `agents` for the agent step as a whole.
        status:
          type: string
          enum:
            - updated
            - unchanged
            - skipped
            - shell
            - cleared
            - would_update
            - would_clear
          description: >-
            `updated`: the agent's file was written. `unchanged`: on an apply,
            the file did not change; in a preview, none of the names would go in
            it (each is in `skipped`). `shell`: the agent has no env file and
            reads `/root/.env`. `cleared`: Orgo's lines for `names` were taken
            out. `skipped`: the file was left alone (`reason`). A preview
            (`dry_run: true`) says `would_update` and `would_clear` in place of
            `updated` and `cleared`.
        reason:
          type: string
          enum:
            - owner_managed
            - unreadable
            - write_failed
            - state_unreadable
          description: >-
            Why a target was skipped. `owner_managed`: a Hermes whose gateway
            its owner runs on their own setup. `unreadable`: Orgo can't read the
            file. `write_failed`: Orgo couldn't write it (never in a preview).
            `state_unreadable`, on `agents`: `/root/.orgo-secrets.agents.json`
            does not parse, so no agent file was touched.
        names:
          type: array
          items:
            type: string
          description: The names written, taken out, or that would be.
        skipped:
          type: array
          description: Names left out of this file. Never a value.
          items:
            type: object
            required:
              - name
              - reason
            properties:
              name:
                type: string
              reason:
                type: string
                enum:
                  - value_format
                  - reserved
                description: >-
                  `value_format`: the value has a single quote, a backslash,
                  `${`, or a line break of any kind, so it stays out of the
                  agent's file and still reaches `/root/.env`. `reserved`
                  (preview only): the agent keeps its own value for this name,
                  such as Hermes' `HERMES_HOME`, `API_SERVER_` and chat app
                  names, Codex's `CODEX_` names, or OpenClaw's `OPENCLAW_`
                  names.
        restart:
          type: string
          enum:
            - openclaw-gateway
            - hermes-gateway
          description: >-
            The supervisord program to restart for the change to take effect.
            `openclaw-gateway` whenever OpenClaw's file changes.
            `hermes-gateway` when a line leaves Hermes' file: a removal, or an
            apply that takes out the old line of a value Hermes' file can't
            hold.
  responses:
    Unauthorized:
      description: 'No usable credential. Send `Authorization: Bearer $ORGO_API_KEY`.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            invalid-key:
              summary: The key is not one of yours
              value:
                error: Invalid API key
            no-credential:
              summary: No key and no session
              value:
                error: Authentication required
    AuthUnavailable:
      description: >-
        Orgo could not verify the credential because of a server-side fault,
        such as a database outage. Retry after `Retry-After`. Do not rotate the
        key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: >-
              Service temporarily unavailable. The database is not accepting
              requests. Retry shortly.
      headers:
        Retry-After:
          description: Seconds to wait before retrying. Always `5`.
          schema:
            type: string
            example: '5'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key authentication. Get your key at orgo.ai/workspaces

````

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