Bind secrets
SDK platic.webhooks.bindSecret()
Bind a workspace secret to a webhook slot. Use it to:
- reuse a credential across several webhooks without sending its value every time,
- reauthorize a slot in
needs_authorizationafter changing the destination.
Example
curl https://api.platic.ai/v1/webhooks/$WEBHOOK_ID/secrets \
-H "Authorization: Bearer $PLATIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "slot": "webhook.secret", "secretId": "secret_123" }' await platic.webhooks.bindSecret("webhook_123", { slot: "webhook.secret", secretId: "secret_123" }); If you prefer to send the value, use secret or headers in update a webhook: Platica creates the secret and binds it for you.
If your credential covers several workspaces, add ?workspace=<id> with the webhook's workspace (list workspaces); without it the answer is 400.
Path parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
webhookId | string | Webhook id | ✓ |
Request body
{
"slot": "webhook.secret",
"secretId": "a1c3e5f7092b4d6f8a0c2e4f6b8d0a1c3e5f7092b4d6f8a0c2e4f6b8d0a1c3e5"
} Body parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
slot | string | The slot: webhook.secret for the signature, or header:<name> for a webhook header, with the name in lowercase | ✓ |
secretId | string | Secret id, from list secrets or create a secret | ✓ |
Response
data contains the complete webhook, with the fields from get a webhook. The slot becomes authorized.
{
"status": "success",
"message": "Secret bound successfully",
"data": {
"id": "webhook_abc123",
"name": "Notifications webhook",
"url": "https://hooks.example.com/platica",
"events": [
"conversation.created",
"message.created"
],
"active": false,
"hasSecret": true,
"headers": {
"Custom-Header": "custom value"
},
"createdAt": "2026-10-28T12:05:00.000Z",
"updatedAt": "2026-11-03T18:44:02.000Z",
"creationDate": "2026-10-28T12:05:00.000Z",
"lastUpdate": "2026-11-03T18:44:02.000Z",
"lastDeliveryAt": "2026-11-03T17:42:10.000Z",
"lastDeliveryStatus": "success",
"lastDeliveryCode": 200,
"lastDeliveryError": null,
"status": "pending_verification",
"version": 7,
"verified": false,
"secrets": [
{
"slot": "webhook.secret",
"state": "authorized",
"secretId": "a1c3e5f7092b4d6f8a0c2e4f6b8d0a1c3e5f7092b4d6f8a0c2e4f6b8d0a1c3e5"
}
],
"workspaceId": "ws_123",
"nextStep": "Inactive. Activate it with PATCH /v1/webhooks/webhook_abc123 and { \"active\": true }; the destination is verified first."
}
} Errors
| Status | details.code | When |
|---|---|---|
400 | INVALID_REQUEST | slot or secretId is missing. details.issues says which |
400 | INVALID_REQUEST | Your credential covers several workspaces and you did not send ?workspace=, or you sent one it does not cover. details.available carries the IDs you can use |
400 | SECRET_SLOT_INVALID | That slot does not exist in the webhook: the header is not configured, or it is Content-Type, User-Agent, or an X-Webhook-* |
400 | SECRET_DESTINATION_INVALID | The webhook URL is not https or is not valid |
401 | UNAUTHENTICATED | The credential is missing or invalid |
403 | FORBIDDEN | An OAuth token without the platica:write scope, the person does not have the Integrations module (the message is Missing integrations permission), cannot use secrets, or does not have permission to configure webhooks |
404 | SECRET_NOT_FOUND | The secret does not exist in this workspace |
404 | NOT_FOUND | The webhook does not exist in the 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 webhook changed while it was being bound. Repeat the call |
{
"code": 400,
"error": "Bad Request - The request has validation errors",
"details": {
"code": "SECRET_SLOT_INVALID",
"message": "Esa ranura no existe en la configuración actual."
}
} The general error format is in Errors.
Notes
- After binding, activate the webhook with test a webhook or send
{ "active": true }in update a webhook. Binding alone does not activate it. - The secret is authorized for that slot and for the webhook's current destination. If you change
urlto another domain, you have to bind again. - To bind
header:<name>, the header has to exist in the webhook'sheaders. Add it with an empty value in update a webhook. - With
webhook.secretbound, every delivery is signed with the value of that secret. Your server must validate with the same value: see Delivery and signatures.