Update an API

SDK platic.tools.apis.update()

Change the request, variables or other settings by sending only the fields you want to update. Other fields are preserved. If you change the definition, bind the secrets again, test and publish the API.

Example

await platic.tools.apis.update("api_123", { description: "Looks up an order and its shipping status." });

Path parameters

ParameterTypeDescriptionRequired
integrationIdstringCustom API ID✓

Request body

{
  "description": "Looks up the status and estimated delivery date of an Example Store order.",
  "expectedVersion": 3,
  "secrets": {
    "auth.token": "5d0c7a1e9b3f4a6c8e2d1f0b7a9c3e5d6f8a0b2c4d6e8f1a3b5c7d9e0f2a4b6c"
  }
}

Sending secrets together with the change binds the slots again in the same call.

It accepts the fields of Create an API, all optional, plus expectedVersion. Send at least one field.

FieldTypeDescriptionRequired
name, description, request, variables—Same as when creating—
context, mapping, response, periodicAuth, encryptPayloadobject | nullSame as when creating. null removes the section—
secretsobjectMap of slot to secret ID. If it is the only thing you send, it only binds and does not touch the definition—
expectedVersionnumberThe version you read. If the stored one is different, it answers 409 instead of overwriting—
  • request and variables are replaced whole. To add a variable, send the entire list with the new one included.
  • A value you received as "[REDACTED]" can be sent back as it is: the stored one is kept.
  • An enabled or paused API cannot be left without request.url.

Response

data has the API after the change, with the fields of Get an API.

{
  "status": "success",
  "message": "API tool updated successfully",
  "data": {
    "id": "RuzoaswTBBrhutHyKYZn",
    "toolName": "api_order_lookup",
    "name": "order_lookup",
    "description": "Looks up the status and estimated delivery date of an Example Store order.",
    "status": "draft",
    "version": 4,
    "variables": [
      {
        "name": "orderId",
        "type": "string",
        "description": "Order number, as it appears in the confirmation email.",
        "required": true,
        "mode": "ai"
      }
    ],
    "response": { "path": "data", "exclude": ["internal_notes"] },
    "request": {
      "method": "GET",
      "url": "https://api.example-store.com/orders/{{orderId}}",
      "headers": [{ "key": "Accept", "value": "application/json" }],
      "auth": { "type": "bearer" }
    },
    "createdAt": "2026-10-28T12:05:03.902Z",
    "updatedAt": "2026-11-03T18:40:12.000Z",
    "lastTest": null,
    "verified": false,
    "secrets": [
      {
        "slot": "auth.token",
        "state": "authorized",
        "secretId": "5d0c7a1e9b3f4a6c8e2d1f0b7a9c3e5d6f8a0b2c4d6e8f1a3b5c7d9e0f2a4b6c"
      }
    ],
    "secretsRedacted": true,
    "nextStep": "Run a real test with POST /v1/tools/apis/RuzoaswTBBrhutHyKYZn/test and dryRun false. Enabling requires a successful real test of the current configuration."
  }
}

What changes when you update

EffectDetail
version goes up by oneUse it as expectedVersion in the next change
verified goes back to falseThe previous test is no longer valid for the new configuration
Slots become needs_authorizationThey keep their secretId. Bind them again, in this call with secrets or with Bind a secret
Slots that no longer exist lose their secretFor example, if you change request.auth.type from bearer to none
enabled goes back to draftConnections to agents are kept and work again when you publish. A paused API stays paused

This applies to any field of the definition, also name and description. If you only send secrets, none of this happens: they are only bound.

Errors

Statusdetails.codeWhen
400INVALID_REQUESTThe body is empty or fails validation. details.issues has the list of problems, or the message No update fields provided
400SECRET_REFERENCE_REQUIREDYou sent a credential inside the definition. When it applies, details.slot says the slot to bind
400INVALID_CONFIGThe resulting definition is not valid, or request.url points to localhost, .local, .internal or a private IP. Use a public URL
403FORBIDDENThe person behind the token does not have access to Integrations
404NOT_FOUNDThe API does not exist in this workspace
409RESOURCE_CHANGEDexpectedVersion does not match, or the API changed while it was being saved. Read it and repeat
409NAME_CONFLICTThe new name is already used by another tool

If the change is saved but a secret in secrets cannot be bound, the response is 200 and data.secretsError has { code, message }.

Notes