Clone an API

SDK platic.tools.apis.clone()

Try a change without modifying a published API, or reuse a working definition. Send the original integrationId and, optionally, a name for the copy. It is created as draft, without the original’s bound secrets or test.

Example

await platic.tools.apis.clone("api_123");

Path parameters

ParameterTypeDescriptionRequired
integrationIdstringID of the API being copied✓

Request body

{
  "name": "order_lookup_test"
}
FieldTypeDescriptionRequired
namestringName of the copy, with the rules from Create an API. Default, the original name followed by _copy—

Response

201 Created. data has the copy, with the fields of Get an API.

{
  "status": "success",
  "message": "API tool cloned successfully",
  "data": {
    "id": "Tq7LmZx2PvR9cKd4WnYb",
    "toolName": "api_order_lookup_test",
    "name": "order_lookup_test",
    "description": "Looks up the status of an Example Store order by its number. Use it when the customer asks where their order is.",
    "status": "draft",
    "version": 1,
    "variables": [
      {
        "name": "orderId",
        "type": "string",
        "description": "Order number, as it appears in the confirmation email.",
        "required": true,
        "mode": "ai"
      }
    ],
    "request": {
      "method": "GET",
      "url": "https://api.example-store.com/orders/{{orderId}}",
      "headers": [{ "key": "Accept", "value": "application/json" }],
      "auth": { "type": "bearer" }
    },
    "createdAt": "2026-11-04T09:12:30.000Z",
    "updatedAt": "2026-11-04T09:12:30.000Z",
    "lastTest": null,
    "verified": false,
    "secrets": [
      { "slot": "auth.token", "state": "missing" }
    ],
    "secretsRedacted": true,
    "nextStep": "Bind a secret to: auth.token. Use POST /v1/tools/apis/Tq7LmZx2PvR9cKd4WnYb/secrets with { slot, secretId }. Secret ids come from GET /v1/secrets; create one with POST /v1/secrets. Slots in \"needs_authorization\" keep their secretId: the definition changed after they were bound, so bind them again."
  }
}

Errors

Statusdetails.codeWhen
400INVALID_REQUESTname does not meet the format. details.issues has the list of problems
403FORBIDDENThe person behind the token does not have access to Integrations
404NOT_FOUNDThe original API does not exist in this workspace
409NAME_CONFLICTAnother tool with that name already exists. Send another name
409RESOURCE_CHANGEDThe original API changed while it was being copied. Repeat the call

Notes

  • The copy’s slots are in missing. Bind the same secrets or others, test and publish.
  • The original does not change.