Subscriptions

Create a webhook subscription

Creates a webhook subscription for the authenticated account and mints its signing secret. The secret is returned once, in this response, and is never retrievable again — store it now.

post/subscriptions

Request

  • Base URL
    https://api.textla.com/v1
  • Auth
    HTTP bearer

Request body

$schemastring uri

A URL to the JSON Schema for this object.

custom_headersobject

Optional additive request headers applied to each delivery (at most 20; each name is non-empty and at most 256 bytes, each value at most 2048 bytes). Advisory: the delivery sink drops any that would shadow a reserved header or carry an unsafe value. Values are NOT secret — stored in plaintext and returned on read, so do not put credentials here.

target_urlstring uri required

Absolute https webhook destination.

typesstring[] nullable required

Event types to subscribe to (must be registered types).

Example request

{
  "$schema": "/v1/schemas/CreateSubscriptionBody.json",
  "target_url": "https://example.com/hooks/sms",
  "types": [
    "campaign.sent"
  ]
}

Response

Created

$schemastring uri

A URL to the JSON Schema for this object.

account_idstring required

Account that owns the subscription.

actionstring required

What a matched event does: deliver a signed webhook, or send a notification to a user.

custom_headersobject nullable required

Additive request headers applied to each delivery. Advisory: the delivery sink drops any that would shadow a reserved header or carry an unsafe value. Values are NOT secret — stored in plaintext and returned on read, so do not put credentials here.

disabledboolean required

A disabled subscription matches nothing.

idstring required

Service-minted subscription id.

secretstring nullable required

The webhook signing secret (the HMAC-SHA256 key). Shown once, at creation, and never retrievable again — store it now. Null when no signing key is configured for the environment, and always null for a notification subscription.

target_urlstring required

Absolute https webhook destination. Empty for a notification subscription.

typesstring[] nullable required

Event types this subscription wants.

Example response

{
  "$schema": "/v1/schemas/CreatedSubscription.json",
  "account_id": "Ab2c3d4f5g6",
  "id": "sub_2c8f...b1",
  "secret": "whsec_A1B2...",
  "target_url": "https://example.com/hooks/sms",
  "types": [
    "campaign.sent"
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.