---
docId: doc_d24d91e847c447cb8a6e93369b08dc0d
title: Publish an API
description: Publish a custom API to the workspace catalog. It requires a real test of the current configuration.
api:
  group: herramientas/apis-personalizadas
  auth: bearer
  operations:
    - operationId: enableApiTool
      method: POST
      path: '/v1/tools/apis/{integrationId}/enable'
      postmanName: Publish an API
---

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

# Publish an API

Enable a tested API so agents can use it. Send its `integrationId`, with no body. It becomes `enabled` in the [workspace catalog](/api-reference/tools/list); connect it to an agent or resume its existing connections. This operation publishes drafts and reactivates paused APIs.

## Requirements

- All slots in `secrets[]` are in `authorized`.
- The last [real test](/api-reference/custom-apis/test) finished well and was made with the current configuration and secrets (`verified: true`).
- Each variable in `ai` mode has a `description`.

## Example

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

```bash
curl -X POST "https://api.platic.ai/v1/tools/apis/$INTEGRATION_ID/enable" \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

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

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

</Ways.Way>
</Ways>

## Path parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `integrationId` | string | Custom API ID | ✓ |

## Request body

It has no body.

## Response

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

```json
{
  "status": "success",
  "message": "API tool enabled successfully",
  "data": {
    "id": "RuzoaswTBBrhutHyKYZn",
    "toolName": "api_order_lookup",
    "name": "order_lookup",
    "description": "Looks up the status of an Example Store order by its number. Use it when the customer asks where their order is.",
    "status": "enabled",
    "version": 3,
    "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-10-28T12:05:03.902Z",
    "updatedAt": "2026-10-28T12:18:44.117Z",
    "lastTest": null,
    "verified": true,
    "secrets": [
      {
        "slot": "auth.token",
        "state": "authorized",
        "secretId": "5d0c7a1e9b3f4a6c8e2d1f0b7a9c3e5d6f8a0b2c4d6e8f1a3b5c7d9e0f2a4b6c"
      }
    ],
    "secretsRedacted": true,
    "nextStep": "Enabled. Connect it to an agent with PUT /v1/agents/{agentId}/tools/RuzoaswTBBrhutHyKYZn.",
    "toolId": "RuzoaswTBBrhutHyKYZn"
  }
}
```

## Response fields

| Field | Type | Description |
|-------|------|-------------|
| `status` | string | `enabled` |
| `toolId` | string | Tool ID in the catalog. It is the same `id` as the API's |
| The rest | — | See [Get an API](/api-reference/custom-apis/get#response-fields) |

## Errors

| Status | `details.code` | When |
|--------|----------------|------|
| `400` | `INVALID_CONFIG` | The definition is not ready: the URL is missing or a variable in `ai` mode has no `description` |
| `403` | `FORBIDDEN` | The person behind the token does not have access to Integrations |
| `404` | `NOT_FOUND` | The API does not exist in this workspace |
| `409` | `VERIFICATION_REQUIRED` | There is no valid real test: it was never tested, the test failed, or the definition or a secret changed afterwards. [Test](/api-reference/custom-apis/test) and repeat |
| `409` | `NAME_CONFLICT` | Another tool in the workspace already uses that name |
| `409` | `RESOURCE_CHANGED` | The API changed while it was being published. Read it and repeat |

## Notes

- Publishing does not give it to any agent. Connect it with [Connect a tool](/api-reference/agents/tools/connect): `PUT /v1/agents/{agentId}/tools/{toolId}`, with the `toolId` from this response.
- If you later [update](/api-reference/custom-apis/update) the API, it goes back to `draft` and you have to test and publish it again.
- To take it out of the catalog without losing the configuration, use [Pause an API](/api-reference/custom-apis/pause).
