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_authorization after changing the destination.

Example

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

ParameterTypeDescriptionRequired
webhookIdstringWebhook id✓

Request body

{
  "slot": "webhook.secret",
  "secretId": "a1c3e5f7092b4d6f8a0c2e4f6b8d0a1c3e5f7092b4d6f8a0c2e4f6b8d0a1c3e5"
}

Body parameters

ParameterTypeDescriptionRequired
slotstringThe slot: webhook.secret for the signature, or header:<name> for a webhook header, with the name in lowercase✓
secretIdstringSecret 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

Statusdetails.codeWhen
400INVALID_REQUESTslot or secretId is missing. details.issues says which
400INVALID_REQUESTYour 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
400SECRET_SLOT_INVALIDThat slot does not exist in the webhook: the header is not configured, or it is Content-Type, User-Agent, or an X-Webhook-*
400SECRET_DESTINATION_INVALIDThe webhook URL is not https or is not valid
401UNAUTHENTICATEDThe credential is missing or invalid
403FORBIDDENAn 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
404SECRET_NOT_FOUNDThe secret does not exist in this workspace
404NOT_FOUNDThe webhook does not exist in the workspace
409SECRET_USE_REVOKEDThe secret is revoked or expired
409SECRET_CHANGEDThe secret changed while it was being bound. Repeat the call
409RESOURCE_CHANGEDThe 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 url to another domain, you have to bind again.
  • To bind header:<name>, the header has to exist in the webhook's headers. Add it with an empty value in update a webhook.
  • With webhook.secret bound, every delivery is signed with the value of that secret. Your server must validate with the same value: see Delivery and signatures.