Get an API

SDK platic.tools.apis.get()

Check what remains before publishing an API. Read status, verified and secrets[].state; nextStep explains the next step. The response includes the full definition without credentials.

Example

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

Path parameters

ParameterTypeDescriptionRequired
integrationIdstringCustom API ID✓

Response

data is the API:

{
  "status": "success",
  "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": "draft",
    "version": 2,
    "variables": [
      {
        "name": "orderId",
        "type": "string",
        "description": "Order number, as it appears in the confirmation email.",
        "required": true,
        "mode": "ai"
      }
    ],
    "response": {
      "path": "data",
      "exclude": ["internal_notes"]
    },
    "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:09:41.300Z",
    "lastTest": null,
    "verified": false,
    "secrets": [
      {
        "slot": "auth.token",
        "state": "needs_authorization",
        "secretId": "5d0c7a1e9b3f4a6c8e2d1f0b7a9c3e5d6f8a0b2c4d6e8f1a3b5c7d9e0f2a4b6c"
      }
    ],
    "secretsRedacted": true,
    "nextStep": "Bind a secret to: auth.token. Use POST /v1/tools/apis/RuzoaswTBBrhutHyKYZn/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."
  }
}

Response fields

This is the shape of an API in every response of this section.

FieldTypeDescription
idstringThe integrationId. When the API is published, it is also its toolId
toolNamestringThe name the agent sees: api_<name>
namestringThe short name you defined
descriptionstringWhat the agent reads to decide when to use it
statusstringdraft, enabled or paused. See lifecycle
versionnumberGoes up with every change. Send it as expectedVersion when you update
requestobjectThe HTTP request. request.auth has the authentication type, never the credential
variablesarrayThe variables, with the shape described in Create an API. The constantValue of a constant variable comes as "[REDACTED]"
context, mapping, response, periodicAuth, encryptPayloadobjectThe optional sections. They only appear if you configured them. encryptPayload has ttlSeconds, never the key
createdAt, updatedAtstring | nullDates in ISO 8601
lastTestobject | nullThe last test made from Platica's editor: trigger, input, outcome, httpStatus, durationMs and at. Tests made with this API do not change it: their result is in verified
verifiedbooleantrue if the last real test finished well and is still valid for this configuration and these secrets
secretsarrayOne entry per slot: slot, state and secretId if a secret is bound. See slot states
secretsRedactedbooleanAlways true: the response has no credentials
secretsErrorobjectOnly when creating or updating with secrets: { code, message } when the API was saved but a secret could not be bound
nextStepstringText in English that says what is missing, in order. It is for people and assistants; do not program against its wording

What nextStep says

SituationnextStep starts with
request.url is missingSet request.url…
There are slots in missing or needs_authorizationBind a secret to: <slots>…
It is publishedEnabled. Connect it to an agent…
A real test is missingRun a real test…
It is paused and verifiedPaused: no agent sees it…
It is verified and unpublishedVerified. Publish it…

To program, use status, verified and secrets[].state.

Errors

Statusdetails.codeWhen
400INVALID_REQUESTThe credential covers several workspaces and workspace is missing or is not one of them
403FORBIDDENThe person behind the token does not have access to Integrations
404NOT_FOUNDThe API does not exist in this workspace

See Errors for the full shape of an error.

Notes

  • Values that look sensitive come as "[REDACTED]": a header's with a credential name, a constant variable's and keys with a credential name in a JSON body.
  • A published API is connected to an agent with Connect a tool: PUT /v1/agents/{agentId}/tools/{toolId}, with the API's id.