Publish an API
SDK platic.tools.apis.enable()
Enable a tested API so agents can use it. Send its integrationId, with no body. It becomes enabled in the workspace catalog; connect it to an agent or resume its existing connections. This operation publishes drafts and reactivates paused APIs.
Requirements
- All slots in
secrets[]are inauthorized. - The last real test finished well and was made with the current configuration and secrets (
verified: true). - Each variable in
aimode has adescription.
Example
curl -X POST "https://api.platic.ai/v1/tools/apis/$INTEGRATION_ID/enable" \
-H "Authorization: Bearer $PLATIC_API_KEY" await platic.tools.apis.enable("api_123"); 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, plus toolId.
{
"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 |
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 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:
PUT /v1/agents/{agentId}/tools/{toolId}, with thetoolIdfrom this response. - If you later update the API, it goes back to
draftand you have to test and publish it again. - To take it out of the catalog without losing the configuration, use Pause an API.