Bind a secret to an API
SDK platic.tools.apis.bindSecret()
Complete a credential slot in missing or needs_authorization. Send slot and an existing secret’s secretId; do not send its value. Find the slot in the API’s secrets[].
Example
curl -X POST "https://api.platic.ai/v1/tools/apis/$INTEGRATION_ID/secrets" \
-H "Authorization: Bearer $PLATIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"slot": "auth.token",
"secretId": "'"$SECRET_ID"'"
}' await platic.tools.apis.bindSecret("api_123", { slot: "auth.token", secretId: "secret_123" }); Path parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
integrationId | string | Custom API ID | ✓ |
Request body
{
"slot": "auth.token",
"secretId": "5d0c7a1e9b3f4a6c8e2d1f0b7a9c3e5d6f8a0b2c4d6e8f1a3b5c7d9e0f2a4b6c"
} | Field | Type | Description | Required |
|---|---|---|---|
slot | string | The slot, as it appears in secrets[].slot: auth.token, auth.password, auth.value, encryptPayload.key, header:<name> or variable:<name> | ✓ |
secretId | string | Secret ID, from List secrets or Create a secret | ✓ |
Response
data has the complete API, with the fields of Get an API. The slot ends up in authorized.
{
"status": "success",
"message": "Secret bound 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": "draft",
"version": 2,
"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:10:02.118Z",
"lastTest": null,
"verified": false,
"secrets": [
{
"slot": "auth.token",
"state": "authorized",
"secretId": "5d0c7a1e9b3f4a6c8e2d1f0b7a9c3e5d6f8a0b2c4d6e8f1a3b5c7d9e0f2a4b6c"
}
],
"secretsRedacted": true,
"nextStep": "Run a real test with POST /v1/tools/apis/RuzoaswTBBrhutHyKYZn/test and dryRun false. Enabling requires a successful real test of the current configuration."
}
} Errors
| Status | details.code | When |
|---|---|---|
400 | INVALID_REQUEST | slot or secretId is missing. details.issues has the list of problems |
400 | SECRET_SLOT_INVALID | That slot does not exist in the API's current configuration |
400 | SECRET_DESTINATION_INVALID | The API does not have a valid https URL. Complete it before binding |
400 | SECRET_VARIABLE_CONFIGURATION_INVALID | A secret variable is misused: it can only go in headers, query parameters or body |
403 | FORBIDDEN | The person behind the token cannot use secrets or does not have access to Integrations |
404 | SECRET_NOT_FOUND | The secret does not exist in this workspace |
404 | NOT_FOUND | The API does not exist in this workspace |
409 | SECRET_USE_REVOKED | The secret is revoked or expired |
409 | SECRET_CHANGED | The secret changed while it was being bound. Repeat the call |
409 | RESOURCE_CHANGED | The API changed while it was being bound. Repeat the call |
409 | SECRET_BINDING_LIMIT | The API already has the maximum number of bound secrets |
Notes
- The secret is authorized for that slot and for the API's current destination. If you later update the definition, the slot goes to
needs_authorizationand you have to repeat this call. - Binding another secret to a slot that already had one replaces it.
- Binding changes the credentials the API was tested with. If it was already verified, test it again before publishing.
- To bind several slots in one call, send
"secrets": { "<slot>": "<secretId>" }in Update an API or in Create an API. - The same secret can be bound to several slots and to several resources.