Operations
Operations

Copy variables

Copy variables from another agent in the same workspace onto this agent's draft. `agent` is the TARGET; `fromAgent` is the SOURCE. Copies plain, secret and default-only variables from the version the source runs live (its published version, or its latest version when none is published). Secret values are read and stored again server-side in the target's own secret store and are never returned, so use this to give an agent the credentials its tools reference (for example a booking API key) without anyone entering them again. Pass `names` to copy only those variables; a name the source does not have fails the call before anything is written. A name the target already has is left as it is and listed under `skipped` unless `overwrite` is true. Even with `overwrite`, a name the target holds as default-only while the source holds it as plain or secret, or the reverse, is skipped with the reason. Overwriting a secret changes only the target's draft; its other versions keep their own values. A variable that cannot be written, such as a secret with no value saved on the source, is listed under `failed` with the reason, and the rest are still copied. The result lists each copied name with its kind, never a value. You need edit access to both agents, and the target must be a draft: call create_draft first if its latest version is published. To make a new agent from an existing one, use duplicate_agent, which copies the variables itself.

POST
/operations/copy_variables

Authorization

bearerAuth
AuthorizationBearer <token>

A personal access token from Settings > API tokens.

In: header

Header Parameters

Idempotency-Key?string

A key you choose, such as a UUID, that makes this POST safe to retry. Within 24 hours the same key and request answers with the first successful answer and runs nothing, the same key with a different request answers 422 idempotency_key_reused, and a key whose request is still running answers 409 idempotency_key_in_use. A failed request keeps nothing, so the same key runs it again.

Length1 <= length <= 255

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X POST "https://example.com/operations/copy_variables" \  -H "Content-Type: application/json" \  -d '{    "fromAgent": "string",    "agent": "string"  }'
{}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}

Connect an app (workspace) POST

Begin connecting an app at the WORKSPACE level and return an authorization link to finish. Connecting alone arms NO agent, the account exists but every agent still loads nothing until it has its own opt-in. Pass shareWithAllAgents: true to give the account to every agent in the workspace as the connect completes. One-click (platform-managed sign-in) and bring-your-own-KEY apps connect through here and return { redirectUrl, status:'pending' } (open the link, then poll list_workspace_connections). Apps needing the operator's OWN OAuth-app credentials can't be connected through a model tool, they return { needsSecret:true, settingsUrl } pointing to Connected apps in the app, which collects them (secrets never pass through this tool). Requires workspace-admin.

Make a connect link POST

Make a lasting link that connects an app for THIS agent, to text or email to whoever owns the account. initiate_agent_connection's redirectUrl dies about 10 minutes after it's made; this link starts a fresh sign-in each time it's opened, so it keeps working for `days` (default 30). Opening it does what initiate_agent_connection does, acting as the workspace owner, and it stops working once the app is connected on this agent. Returns `{ url, until }`. Anyone holding the link can connect an account to this agent until then, so send it only to the account's owner. Apps that need the operator's own OAuth-app credentials can't be connected from a link; connect those in Connected apps in the app. Requires workspace-admin.