---
docId: doc_564cde1be7d440a7ab1307dc4b9552cd
title: Clone an API
description: Copy a custom API as a new draft, without its bound secrets.
api:
  group: herramientas/apis-personalizadas
  auth: bearer
  operations:
    - operationId: cloneApiTool
      method: POST
      path: '/v1/tools/apis/{integrationId}/clone'
      postmanName: Clone an API
---

<script>
  import { Ways } from '$lib/components';
</script>

# Clone an API

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

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
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"
}'
```

</Ways.Way>
<Ways.Way name="sdk">

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

</Ways.Way>
</Ways>

## Path parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `integrationId` | string | ID of the API being copied | ✓ |

## Request body

```json
{
  "name": "order_lookup_test"
}
```

| Field | Type | Description | Required |
|-------|------|-------------|----------|
| `name` | string | Name of the copy, with the rules from [Create an API](/api-reference/custom-apis/create#request-body). Default, the original name followed by `_copy` | — |

## Response

`201 Created`. `data` has the copy, with the fields of [Get an API](/api-reference/custom-apis/get#response-fields).

```json
{
  "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 |

## Notes

- The copy’s slots are in `missing`. [Bind](/api-reference/custom-apis/bind-secret) the same secrets or others, [test](/api-reference/custom-apis/test) and [publish](/api-reference/custom-apis/publish).
- The original does not change.
