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 in authorized.
  • The last real test finished well and was made with the current configuration and secrets (verified: true).
  • Each variable in ai mode has a description.

Example

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

Path parameters

ParameterTypeDescriptionRequired
integrationIdstringCustom 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

FieldTypeDescription
statusstringenabled
toolIdstringTool ID in the catalog. It is the same id as the API's
The rest—See Get an API

Errors

Statusdetails.codeWhen
400INVALID_CONFIGThe definition is not ready: the URL is missing or a variable in ai mode has no description
403FORBIDDENThe person behind the token does not have access to Integrations
404NOT_FOUNDThe API does not exist in this workspace
409VERIFICATION_REQUIREDThere is no valid real test: it was never tested, the test failed, or the definition or a secret changed afterwards. Test and repeat
409NAME_CONFLICTAnother tool in the workspace already uses that name
409RESOURCE_CHANGEDThe 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 the toolId from this response.
  • If you later 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.