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
curl -X POST "https://api.platic.ai/v1/tools/apis/$INTEGRATION_ID/clone" \
-H "Authorization: Bearer $PLATIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "order_lookup_test"
}' await platic.tools.apis.clone("api_123"); Path parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
integrationId | string | ID of the API being copied | ✓ |
Request body
{
"name": "order_lookup_test"
} | Field | Type | Description | Required |
|---|---|---|---|
name | string | Name 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
| Status | details.code | When |
|---|---|---|
400 | INVALID_REQUEST | name does not meet the format. details.issues has the list of problems |
403 | FORBIDDEN | The person behind the token does not have access to Integrations |
404 | NOT_FOUND | The original API does not exist in this workspace |
409 | NAME_CONFLICT | Another tool with that name already exists. Send another name |
409 | RESOURCE_CHANGED | The original API changed while it was being copied. Repeat the call |