{"openapi":"3.1.0","paths":{"/v1/project":{"get":{"operationId":"CurrentProject_get","parameters":[],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Get the project of this API key","tags":["Project"]}},"/v1/instances":{"post":{"description":"Creates a WhatsApp instance (one linked WhatsApp account) in the project. The instance starts DISCONNECTED; call `POST /v1/instances/{id}/connect` to pair it. Use `externalReference` to map it to your own tenant or user.","operationId":"Instances_create","parameters":[{"name":"Idempotency-Key","in":"header","description":"Unique key (max 255 printable ASCII chars). Retrying with the same key and body returns the original response instead of performing the action twice. Keys are kept for 24 hours.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInstanceRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Instance"}}}},"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE, INSTANCE_LIMIT_REACHED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: EXTERNAL_REFERENCE_TAKEN, IDEMPOTENCY_KEY_REUSED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Create an instance","tags":["Instances"]},"get":{"description":"Filter by `externalReference` to look up the instance of one of your tenants.","operationId":"Instances_list","parameters":[{"name":"limit","required":false,"in":"query","description":"Page size (1-100).","schema":{"minimum":1,"maximum":100,"default":25,"type":"integer"}},{"name":"cursor","required":false,"in":"query","description":"Opaque cursor from `pagination.nextCursor`.","schema":{"maxLength":200,"type":"string"}},{"name":"externalReference","required":false,"in":"query","description":"Exact match on externalReference.","schema":{"maxLength":200,"type":"string"}},{"name":"status","required":false,"in":"query","schema":{"$ref":"#/components/schemas/InstanceStatus"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstanceList"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"List instances","tags":["Instances"]}},"/v1/instances/{instanceId}":{"get":{"operationId":"Instances_get","parameters":[{"name":"instanceId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Instance"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Get an instance","tags":["Instances"]},"patch":{"description":"Rename an instance or replace its metadata.","operationId":"Instances_update","parameters":[{"name":"instanceId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInstanceRequest"}}}},"responses":{"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Instance"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Update an instance","tags":["Instances"]},"delete":{"description":"Unlinks the device from WhatsApp, wipes its credentials and fails messages that are still queued. Other instances are not affected. Irreversible.","operationId":"Instances_remove","parameters":[{"name":"instanceId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Delete an instance","tags":["Instances"]}},"/v1/instances/{instanceId}/connect":{"post":{"description":"Asks the session worker to connect. If the instance has never been linked (or was logged out), a QR code or pairing code becomes available shortly at `GET /v1/instances/{id}/qr`. Connecting is asynchronous: poll `GET .../status` or subscribe to `instance.*` webhooks. Calling it while already connected is a no-op.","operationId":"Instances_connect","parameters":[{"name":"instanceId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectInstanceRequest"}}}},"responses":{"202":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstanceStatusResponse"}}}},"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: INSTANCE_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Start connecting","tags":["Instances"]}},"/v1/instances/{instanceId}/status":{"get":{"operationId":"Instances_status","parameters":[{"name":"instanceId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstanceStatusResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Get connection status","tags":["Instances"]}},"/v1/instances/{instanceId}/qr":{"get":{"description":"Returns the current short-lived QR (raw and as PNG data URL) or pairing code while the instance status is `QR_REQUIRED` / `PAIRING_CODE_REQUIRED`. Codes rotate; fetch again after `expiresAt`. Never expose this response to anyone other than the account owner.","operationId":"Instances_qr","parameters":[{"name":"instanceId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: QR_NOT_AVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PairingResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Get the current QR or pairing code","tags":["Instances"]}},"/v1/instances/{instanceId}/reconnect":{"post":{"description":"Restarts the connection of a previously linked instance using its stored credentials.","operationId":"Instances_reconnect","parameters":[{"name":"instanceId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"202":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstanceStatusResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: INSTANCE_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Reconnect","tags":["Instances"]}},"/v1/instances/{instanceId}/disconnect":{"post":{"description":"Closes the connection but keeps the link, so `reconnect` works without a new QR scan. Queued messages wait.","operationId":"Instances_disconnect","parameters":[{"name":"instanceId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"202":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstanceStatusResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Disconnect (keep credentials)","tags":["Instances"]}},"/v1/instances/{instanceId}/logout":{"post":{"description":"Unlinks the device from the WhatsApp account and wipes credentials. A new QR scan is needed to connect again.","operationId":"Instances_logout","parameters":[{"name":"instanceId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"202":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstanceStatusResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Log out (unlink device)","tags":["Instances"]}},"/v1/instances/{instanceId}/connect-sessions":{"post":{"description":"Returns a short-lived URL of a WhatsTIG-hosted page that shows only this instance's QR and status. Give it to the account owner (e.g. a school administrator) so they can link their phone without a WhatsTIG login. The link expires, stops showing QR codes after a successful connection, and must be treated as a secret.","operationId":"Instances_connectSession","parameters":[{"name":"instanceId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateConnectSessionRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectSession"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Create a hosted connect link","tags":["Instances"]}},"/v1/messages":{"post":{"description":"Durably accepts a message for asynchronous sending and returns `202` with status `QUEUED`. This does NOT mean the message was delivered: track progress with `GET /v1/messages/{id}` or `message.*` webhooks. An `Idempotency-Key` header is required; retrying with the same key never creates a second message.","operationId":"Messages_send","parameters":[{"name":"Idempotency-Key","in":"header","description":"Unique key (max 255 printable ASCII chars). Retrying with the same key and body returns the original response instead of performing the action twice. Keys are kept for 24 hours.","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageRequest"}}}},"responses":{"202":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageResponse"}}}},"400":{"description":"Error codes: VALIDATION_ERROR, IDEMPOTENCY_KEY_REQUIRED, INVALID_RECIPIENT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE, QUOTA_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: INSTANCE_STATE_CONFLICT, MEDIA_NOT_READY, IDEMPOTENCY_KEY_REUSED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED, BACKLOG_LIMIT_REACHED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Send a message","tags":["Messages"]},"get":{"description":"Newest first. Filter by instance, direction, status, client reference and creation time.","operationId":"Messages_list","parameters":[{"name":"limit","required":false,"in":"query","description":"Page size (1-100).","schema":{"minimum":1,"maximum":100,"default":25,"type":"integer"}},{"name":"cursor","required":false,"in":"query","description":"Opaque cursor from `pagination.nextCursor`.","schema":{"maxLength":200,"type":"string"}},{"name":"instanceId","required":false,"in":"query","schema":{"type":"string"}},{"name":"direction","required":false,"in":"query","schema":{"type":"string","enum":["outbound","inbound"]}},{"name":"status","required":false,"in":"query","schema":{"$ref":"#/components/schemas/MessageStatus"}},{"name":"clientReference","required":false,"in":"query","schema":{"maxLength":200,"type":"string"}},{"name":"createdAfter","required":false,"in":"query","schema":{"format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","type":"string"}},{"name":"createdBefore","required":false,"in":"query","schema":{"format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","type":"string"}}],"responses":{"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageList"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"List messages","tags":["Messages"]}},"/v1/messages/{messageId}":{"get":{"operationId":"Messages_get","parameters":[{"name":"messageId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Get a message","tags":["Messages"]}},"/v1/messages/{messageId}/events":{"get":{"description":"Each transition carries a certainty: `confirmed` (acknowledged by WhatsApp), `inferred`, or `unknown`.","operationId":"Messages_events","parameters":[{"name":"messageId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageStatusHistory"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Get the status history of a message","tags":["Messages"]}},"/v1/media":{"post":{"description":"Upload an image (JPEG, PNG, WebP; default max 5 MB) or document (PDF, Office, TXT, CSV, ZIP; default max 50 MB) as `multipart/form-data` with a single `file` field. The file content must match its declared type. Use the returned `id` as `content.mediaId` when sending. Media expires after the retention period of your plan.","operationId":"Media_upload","parameters":[],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"}}}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Media"}}}},"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Error codes: PAYLOAD_TOO_LARGE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Error codes: UNSUPPORTED_MEDIA_TYPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Upload media","tags":["Media"]}},"/v1/media/import":{"post":{"description":"WhatsTIG downloads the file from a public HTTPS URL (no redirects, private addresses rejected) and stores it like an upload.","operationId":"Media_importFromUrl","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportMediaRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Media"}}}},"400":{"description":"Error codes: VALIDATION_ERROR, WEBHOOK_URL_REJECTED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Error codes: PAYLOAD_TOO_LARGE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Error codes: UNSUPPORTED_MEDIA_TYPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Import media from a URL","tags":["Media"]}},"/v1/media/{mediaId}":{"get":{"operationId":"Media_get","parameters":[{"name":"mediaId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Media"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Get media metadata","tags":["Media"]}},"/v1/media/{mediaId}/download":{"get":{"description":"Returns a pre-signed URL valid for 5 minutes. Works for uploaded and received media.","operationId":"Media_download","parameters":[{"name":"mediaId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaDownload"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Get a short-lived download URL","tags":["Media"]}},"/v1/webhooks":{"post":{"description":"Events are POSTed as JSON and signed with HMAC-SHA256 (`WhatsTIG-Signature` header). The signing `secret` is returned only in this response. Delivery is at-least-once: deduplicate on the event `id`.","operationId":"Webhooks_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointWithSecret"}}}},"400":{"description":"Error codes: VALIDATION_ERROR, WEBHOOK_URL_REJECTED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: QUOTA_EXCEEDED, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Register a webhook endpoint","tags":["Webhooks"]},"get":{"operationId":"Webhooks_list","parameters":[],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointList"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"List webhook endpoints","tags":["Webhooks"]}},"/v1/webhooks/{webhookId}":{"get":{"operationId":"Webhooks_get","parameters":[{"name":"webhookId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Get a webhook endpoint","tags":["Webhooks"]},"patch":{"description":"Change URL or subscribed events, or enable/disable it. Re-enabling resets the failure counter.","operationId":"Webhooks_update","parameters":[{"name":"webhookId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWebhookRequest"}}}},"responses":{"400":{"description":"Error codes: VALIDATION_ERROR, WEBHOOK_URL_REJECTED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Update a webhook endpoint","tags":["Webhooks"]},"delete":{"operationId":"Webhooks_remove","parameters":[{"name":"webhookId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Delete a webhook endpoint","tags":["Webhooks"]}},"/v1/webhooks/{webhookId}/rotate-secret":{"post":{"description":"Returns the new secret once. The old secret stops being used immediately.","operationId":"Webhooks_rotate","parameters":[{"name":"webhookId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointWithSecret"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Rotate the signing secret","tags":["Webhooks"]}},"/v1/webhooks/{webhookId}/test":{"post":{"description":"Queues a signed `webhook.test` event for this endpoint only. Inspect the result under deliveries.","operationId":"Webhooks_test","parameters":[{"name":"webhookId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"202":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Send a test event","tags":["Webhooks"]}},"/v1/webhooks/{webhookId}/deliveries":{"get":{"description":"Delivery attempts for this endpoint, newest first.","operationId":"Webhooks_deliveries","parameters":[{"name":"webhookId","required":true,"in":"path","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Page size (1-100).","schema":{"minimum":1,"maximum":100,"default":25,"type":"integer"}},{"name":"cursor","required":false,"in":"query","description":"Opaque cursor from `pagination.nextCursor`.","schema":{"maxLength":200,"type":"string"}},{"name":"status","required":false,"in":"query","schema":{"type":"string","enum":["pending","succeeded","failed","dead"]}},{"name":"eventType","required":false,"in":"query","schema":{"$ref":"#/components/schemas/WebhookEventType"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryList"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"List deliveries","tags":["Webhooks"]}},"/v1/webhooks/{webhookId}/deliveries/{deliveryId}":{"get":{"operationId":"Webhooks_delivery","parameters":[{"name":"webhookId","required":true,"in":"path","schema":{"type":"string"}},{"name":"deliveryId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryDetail"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Get a delivery with its attempts and event body","tags":["Webhooks"]}},"/v1/webhooks/{webhookId}/deliveries/{deliveryId}/replay":{"post":{"description":"Schedules the same event (same event ID) for redelivery to this endpoint.","operationId":"Webhooks_replay","parameters":[{"name":"webhookId","required":true,"in":"path","schema":{"type":"string"}},{"name":"deliveryId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"202":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Replay a delivery","tags":["Webhooks"]}},"/v1/events":{"get":{"description":"Every event emitted for the project, whether or not a webhook is registered. Useful for polling and reconciliation.","operationId":"Events_list","parameters":[{"name":"limit","required":false,"in":"query","description":"Page size (1-100).","schema":{"minimum":1,"maximum":100,"default":25,"type":"integer"}},{"name":"cursor","required":false,"in":"query","description":"Opaque cursor from `pagination.nextCursor`.","schema":{"maxLength":200,"type":"string"}},{"name":"type","required":false,"in":"query","schema":{"$ref":"#/components/schemas/WebhookEventType"}},{"name":"instanceId","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventList"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"List events","tags":["Events"]}},"/v1/events/{eventId}":{"get":{"operationId":"Events_get","parameters":[{"name":"eventId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Get an event","tags":["Events"]}},"/v1/keys":{"get":{"description":"Metadata only; secrets are never returned after creation.","operationId":"ApiKeys_list","parameters":[],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyList"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"List API keys","tags":["API keys"]},"post":{"description":"The full key is returned once. A key can only create keys with a subset of its own scopes.","operationId":"ApiKeys_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyWithSecret"}}}},"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Create an API key","tags":["API keys"]}},"/v1/keys/{keyId}":{"delete":{"description":"Takes effect immediately on all API servers.","operationId":"ApiKeys_revoke","parameters":[{"name":"keyId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Revoke an API key","tags":["API keys"]}},"/v1/keys/{keyId}/rotate":{"post":{"description":"Creates a replacement with the same name and scopes and revokes the old key.","operationId":"ApiKeys_rotate","parameters":[{"name":"keyId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyWithSecret"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Rotate an API key","tags":["API keys"]}},"/v1/usage":{"get":{"description":"Daily usage for the project. `messages.sent` counts only messages WhatsApp confirmed; queued, failed and unknown messages are not counted as sent.","operationId":"Usage_get","parameters":[{"name":"from","required":false,"in":"query","description":"Inclusive start date (UTC), default: first day of current month.","schema":{"format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","type":"string"}},{"name":"to","required":false,"in":"query","description":"Inclusive end date (UTC), default: today.","schema":{"format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","type":"string"}},{"name":"instanceId","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Get usage","tags":["Usage"]}},"/v1/conversations":{"get":{"description":"Team inbox threads (one per instance and contact). Requires the inbox to be enabled for the project. Latest activity first by default.","operationId":"Conversations_list","parameters":[{"name":"limit","required":false,"in":"query","description":"Page size (1-100).","schema":{"minimum":1,"maximum":100,"default":25,"type":"integer"}},{"name":"cursor","required":false,"in":"query","description":"Opaque cursor from `pagination.nextCursor`.","schema":{"maxLength":200,"type":"string"}},{"name":"status","required":false,"in":"query","description":"`open` also includes `pending`.","schema":{"default":"open","type":"string","enum":["open","pending","snoozed","resolved","all"]}},{"name":"assignee","required":false,"in":"query","description":"`me`, `none` or a user ID.","schema":{"maxLength":64,"type":"string"}},{"name":"teamId","required":false,"in":"query","schema":{"type":"string"}},{"name":"tagId","required":false,"in":"query","schema":{"type":"string"}},{"name":"instanceId","required":false,"in":"query","schema":{"type":"string"}},{"name":"unread","required":false,"in":"query","schema":{"type":"string"}},{"name":"q","required":false,"in":"query","description":"Search contact names, numbers and message text.","schema":{"maxLength":100,"type":"string"}},{"name":"sort","required":false,"in":"query","description":"`recent`: latest activity first; `oldest`: oldest activity first; `waiting`: longest-waiting customer first.","schema":{"default":"recent","type":"string","enum":["recent","oldest","waiting"]}}],"responses":{"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE, FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationList"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"List conversations","tags":["Conversations"]},"post":{"description":"Writes to a phone number from the team inbox. Continues the existing thread with that person on the instance, if any.","operationId":"Conversations_start","parameters":[{"name":"Idempotency-Key","in":"header","description":"Unique key (max 255 printable ASCII chars). Retrying with the same key and body returns the original response instead of performing the action twice. Keys are kept for 24 hours.","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartConversationRequest"}}}},"responses":{"202":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartConversationResponse"}}}},"400":{"description":"Error codes: VALIDATION_ERROR, IDEMPOTENCY_KEY_REQUIRED, INVALID_RECIPIENT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: QUOTA_EXCEEDED, FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE, FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: INSTANCE_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED, BACKLOG_LIMIT_REACHED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Start a conversation","tags":["Conversations"]}},"/v1/conversations/{conversationId}":{"get":{"operationId":"Conversations_get","parameters":[{"name":"conversationId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE, FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Conversation"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Get a conversation","tags":["Conversations"]},"patch":{"description":"Change status (open, pending, snoozed, resolved), assignee, team or priority. Pass `version` to reject concurrent changes with CONFLICT.","operationId":"Conversations_update","parameters":[{"name":"conversationId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateConversationRequest"}}}},"responses":{"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE, FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Conversation"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Update a conversation","tags":["Conversations"]}},"/v1/conversations/{conversationId}/timeline":{"get":{"description":"Messages, internal notes and activity, oldest first. Page backwards with `before`.","operationId":"Conversations_timeline","parameters":[{"name":"conversationId","required":true,"in":"path","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","schema":{"minimum":1,"maximum":100,"default":50,"type":"integer"}},{"name":"before","required":false,"in":"query","description":"Cursor: return items older than this.","schema":{"maxLength":200,"type":"string"}}],"responses":{"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE, FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationTimeline"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Get the conversation timeline","tags":["Conversations"]}},"/v1/conversations/{conversationId}/messages":{"post":{"description":"Queues a reply to the contact (status QUEUED, like POST /v1/messages). Pass `lastSeenMessageId` to fail with REPLY_COLLISION if a teammate replied in the meantime.","operationId":"Conversations_reply","parameters":[{"name":"conversationId","required":true,"in":"path","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","description":"Unique key (max 255 printable ASCII chars). Retrying with the same key and body returns the original response instead of performing the action twice. Keys are kept for 24 hours.","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationReplyRequest"}}}},"responses":{"202":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxMessage"}}}},"400":{"description":"Error codes: VALIDATION_ERROR, IDEMPOTENCY_KEY_REQUIRED, INVALID_RECIPIENT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: QUOTA_EXCEEDED, FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE, FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: INSTANCE_STATE_CONFLICT, MEDIA_NOT_READY, REPLY_COLLISION","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED, BACKLOG_LIMIT_REACHED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Reply in a conversation","tags":["Conversations"]}},"/v1/conversations/{conversationId}/tags":{"put":{"description":"Replaces the tags of the conversation.","operationId":"Conversations_setTags","parameters":[{"name":"conversationId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetConversationTagsRequest"}}}},"responses":{"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE, FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Conversation"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Set conversation tags","tags":["Conversations"]}},"/v1/conversations/{conversationId}/notes":{"post":{"description":"Visible to your team only; never sent to WhatsApp. Mention teammates with `<@userId>`.","operationId":"Conversations_createNote","parameters":[{"name":"conversationId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateNoteRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Note"}}}},"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE, FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Add an internal note","tags":["Conversations"]}},"/v1/conversations/{conversationId}/notes/{noteId}":{"patch":{"operationId":"Conversations_updateNote","parameters":[{"name":"conversationId","required":true,"in":"path","schema":{"type":"string"}},{"name":"noteId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateNoteRequest"}}}},"responses":{"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE, FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Note"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Edit an internal note","tags":["Conversations"]},"delete":{"operationId":"Conversations_deleteNote","parameters":[{"name":"conversationId","required":true,"in":"path","schema":{"type":"string"}},{"name":"noteId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE, FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Delete an internal note","tags":["Conversations"]}},"/v1/contacts/imports":{"post":{"description":"Upload a CSV (UTF-8, header row, max 20 MB) as `multipart/form-data` with an `options` JSON field (column mapping, tags, consent attestation) followed by the `file` field. The import runs in the background; poll it for progress.","operationId":"ContactImports_create","parameters":[],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["options","file"],"properties":{"options":{"type":"string","description":"JSON-encoded ContactImportOptions"},"file":{"type":"string","format":"binary"}}}}}},"responses":{"202":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactImport"}}}},"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Error codes: PAYLOAD_TOO_LARGE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Import contacts from CSV","tags":["Contacts"]},"get":{"operationId":"ContactImports_list","parameters":[{"name":"limit","required":false,"in":"query","description":"Page size (1-100).","schema":{"minimum":1,"maximum":100,"default":25,"type":"integer"}},{"name":"cursor","required":false,"in":"query","description":"Opaque cursor from `pagination.nextCursor`.","schema":{"maxLength":200,"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactImportList"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"List contact imports","tags":["Contacts"]}},"/v1/contacts/imports/{importId}":{"get":{"operationId":"ContactImports_get","parameters":[{"name":"importId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactImport"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Get a contact import","tags":["Contacts"]}},"/v1/contacts/imports/{importId}/errors":{"get":{"description":"Up to 1,000 rows with the reason; further errors are only counted.","operationId":"ContactImports_errors","parameters":[{"name":"importId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactImportErrorList"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Rows that could not be imported","tags":["Contacts"]}},"/v1/contacts/imports/{importId}/cancel":{"post":{"description":"Stops after the batch in progress. Contacts already imported are kept.","operationId":"ContactImports_cancel","parameters":[{"name":"importId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactImport"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Cancel a contact import","tags":["Contacts"]}},"/v1/contacts":{"get":{"description":"People in this project: added through the API, imports and the dashboard, or by messaging you. Filter by search text, tag, consent or segment.","operationId":"Contacts_list","parameters":[{"name":"limit","required":false,"in":"query","description":"Page size (1-100).","schema":{"minimum":1,"maximum":100,"default":25,"type":"integer"}},{"name":"cursor","required":false,"in":"query","description":"Opaque cursor from `pagination.nextCursor`.","schema":{"maxLength":200,"type":"string"}},{"name":"q","required":false,"in":"query","description":"Search by name or phone number.","schema":{"maxLength":100,"type":"string"}},{"name":"tagId","required":false,"in":"query","schema":{"type":"string"}},{"name":"consentStatus","required":false,"in":"query","schema":{"$ref":"#/components/schemas/ConsentStatus"}},{"name":"segmentId","required":false,"in":"query","description":"Only contacts matching this segment.","schema":{"type":"string"}}],"responses":{"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactList"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"List contacts","tags":["Contacts"]},"post":{"description":"Upsert by phone number (and your `externalId`, when given). Attributes are merged and tags added. Pass `consent` to record an opt-in with its proof; it is ignored (and reported) for a contact who opted out.","operationId":"Contacts_upsert","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertContactRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertContactResponse"}}}},"400":{"description":"Error codes: VALIDATION_ERROR, INVALID_RECIPIENT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: CONTACT_LIMIT_REACHED, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Create or update a contact","tags":["Contacts"]}},"/v1/contacts/batch":{"post":{"description":"Up to 1,000 contacts per request; each one succeeds or fails on its own.","operationId":"Contacts_batch","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchUpsertContactsRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchUpsertContactsResponse"}}}},"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Create or update contacts in bulk","tags":["Contacts"]}},"/v1/contacts/bulk-tags":{"post":{"description":"Add and/or remove tags on a list of contacts (up to 1,000) or every contact in a segment.","operationId":"Contacts_bulkTags","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkContactTagsRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkContactTagsResponse"}}}},"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Tag contacts in bulk","tags":["Contacts"]}},"/v1/contacts/{contactId}":{"get":{"operationId":"Contacts_get","parameters":[{"name":"contactId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Get a contact","tags":["Contacts"]},"patch":{"description":"Set the display name, notes, external id and custom attributes (replaced as a whole).","operationId":"Contacts_update","parameters":[{"name":"contactId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateContactRequest"}}}},"responses":{"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Update a contact","tags":["Contacts"]},"delete":{"description":"Permanently deletes the contact, its conversations, all their messages, notes and media (for data subject requests). An opt-out is remembered as a hash of the number so the person is not messaged again if re-added.","operationId":"Contacts_erase","parameters":[{"name":"contactId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FORBIDDEN, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Erase a contact","tags":["Contacts"]}},"/v1/contacts/{contactId}/tags":{"put":{"description":"Replaces the tags of the contact.","operationId":"Contacts_setTags","parameters":[{"name":"contactId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetContactTagsRequest"}}}},"responses":{"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Set contact tags","tags":["Contacts"]}},"/v1/contacts/{contactId}/opt-out":{"post":{"description":"The contact will not receive campaigns until they send START (or an owner overrides it).","operationId":"Contacts_optOut","parameters":[{"name":"contactId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptOutContactRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Opt a contact out","tags":["Contacts"]}},"/v1/contacts/{contactId}/consent":{"post":{"description":"Record that the contact agreed to receive messages, with optional proof. Fails for contacts who opted out.","operationId":"Contacts_consent","parameters":[{"name":"contactId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordConsentRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}}},"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FORBIDDEN, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: CONTACT_OPTED_OUT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Record an opt-in","tags":["Contacts"]}},"/v1/contacts/{contactId}/consent-events":{"get":{"description":"Every opt-in and opt-out of the contact with its source and proof, newest first.","operationId":"Contacts_consentEvents","parameters":[{"name":"contactId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentEventList"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Consent history","tags":["Contacts"]}},"/v1/tags":{"get":{"description":"Tags of the project, used on contacts and team inbox conversations.","operationId":"Tags_list","parameters":[],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagList"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"List tags","tags":["Contacts"]},"post":{"operationId":"Tags_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTagRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tag"}}}},"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Create a tag","tags":["Contacts"]}},"/v1/tags/{tagId}":{"patch":{"operationId":"Tags_update","parameters":[{"name":"tagId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTagRequest"}}}},"responses":{"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tag"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Update a tag","tags":["Contacts"]},"delete":{"description":"Removes the tag from every contact and conversation.","operationId":"Tags_delete","parameters":[{"name":"tagId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Delete a tag","tags":["Contacts"]}},"/v1/segments":{"get":{"description":"Saved audience definitions. Requires a plan with campaigns.","operationId":"Segments_list","parameters":[{"name":"limit","required":false,"in":"query","description":"Page size (1-100).","schema":{"minimum":1,"maximum":100,"default":25,"type":"integer"}},{"name":"cursor","required":false,"in":"query","description":"Opaque cursor from `pagination.nextCursor`.","schema":{"maxLength":200,"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentList"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"List segments","tags":["Segments"]},"post":{"operationId":"Segments_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSegmentRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Segment"}}}},"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Create a segment","tags":["Segments"]}},"/v1/segments/preview":{"post":{"description":"Count the contacts matching a rule, how many a campaign could message under the current consent mode, and a sample.","operationId":"Segments_preview","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentPreviewRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentPreview"}}}},"400":{"description":"Error codes: VALIDATION_ERROR, SEGMENT_TOO_COMPLEX","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Preview an audience","tags":["Segments"]}},"/v1/segments/{segmentId}":{"get":{"operationId":"Segments_get","parameters":[{"name":"segmentId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Segment"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Get a segment","tags":["Segments"]},"patch":{"description":"Campaigns already launched keep the rule they started with.","operationId":"Segments_update","parameters":[{"name":"segmentId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSegmentRequest"}}}},"responses":{"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Segment"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Update a segment","tags":["Segments"]},"delete":{"operationId":"Segments_delete","parameters":[{"name":"segmentId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Delete a segment","tags":["Segments"]}},"/v1/segments/{segmentId}/preview":{"get":{"operationId":"Segments_previewSaved","parameters":[{"name":"segmentId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"400":{"description":"Error codes: SEGMENT_TOO_COMPLEX","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentPreview"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Preview a saved segment","tags":["Segments"]}},"/v1/campaigns":{"get":{"description":"Newest first. Requires a plan with campaigns.","operationId":"Campaigns_list","parameters":[{"name":"limit","required":false,"in":"query","description":"Page size (1-100).","schema":{"minimum":1,"maximum":100,"default":25,"type":"integer"}},{"name":"cursor","required":false,"in":"query","description":"Opaque cursor from `pagination.nextCursor`.","schema":{"maxLength":200,"type":"string"}},{"name":"status","required":false,"in":"query","schema":{"$ref":"#/components/schemas/CampaignStatus"}}],"responses":{"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignList"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"List campaigns","tags":["Campaigns"]},"post":{"description":"Everything can still change until you launch it.","operationId":"Campaigns_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCampaignRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: MEDIA_NOT_READY","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Create a campaign draft","tags":["Campaigns"]}},"/v1/campaigns/render-preview":{"post":{"description":"Fill the variables for one contact (or sample values) and report missing ones.","operationId":"Campaigns_renderPreview","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenderCampaignPreviewRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenderCampaignPreview"}}}},"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Render a campaign message","tags":["Campaigns"]}},"/v1/campaigns/{campaignId}":{"get":{"description":"Includes delivery stats (refreshed every few seconds while it runs).","operationId":"Campaigns_get","parameters":[{"name":"campaignId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Get a campaign","tags":["Campaigns"]},"patch":{"description":"Pass `version` to fail with CONFLICT if someone else changed it.","operationId":"Campaigns_update","parameters":[{"name":"campaignId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCampaignRequest"}}}},"responses":{"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: CONFLICT, CAMPAIGN_STATE_CONFLICT, MEDIA_NOT_READY","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Update a campaign draft","tags":["Campaigns"]},"delete":{"description":"Drafts and finished campaigns only. Cancel a running campaign first.","operationId":"Campaigns_delete","parameters":[{"name":"campaignId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: CAMPAIGN_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Delete a campaign","tags":["Campaigns"]}},"/v1/campaigns/{campaignId}/launch":{"post":{"description":"Validates the campaign and schedules it to start now or at `scheduledAt`. The audience is frozen when it starts. Requires an Idempotency-Key and the campaigns:launch scope.","operationId":"Campaigns_launch","parameters":[{"name":"campaignId","required":true,"in":"path","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","description":"Unique key (max 255 printable ASCII chars). Retrying with the same key and body returns the original response instead of performing the action twice. Keys are kept for 24 hours.","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LaunchCampaignRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"400":{"description":"Error codes: VALIDATION_ERROR, IDEMPOTENCY_KEY_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: CAMPAIGN_LIMIT_REACHED, FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: IDEMPOTENCY_KEY_REUSED, CAMPAIGN_STATE_CONFLICT, INSTANCE_STATE_CONFLICT, MEDIA_NOT_READY","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Launch a campaign","tags":["Campaigns"]}},"/v1/campaigns/{campaignId}/unschedule":{"post":{"description":"Back to draft, before it starts.","operationId":"Campaigns_unschedule","parameters":[{"name":"campaignId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: CAMPAIGN_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Unschedule a campaign","tags":["Campaigns"]}},"/v1/campaigns/{campaignId}/pause":{"post":{"description":"No new messages are released; the few already queued per number still go out.","operationId":"Campaigns_pause","parameters":[{"name":"campaignId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: CAMPAIGN_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Pause a campaign","tags":["Campaigns"]}},"/v1/campaigns/{campaignId}/resume":{"post":{"description":"Continue a paused campaign. If a number can no longer send, pass `reassignInstanceIds` to move its pending recipients.","operationId":"Campaigns_resume","parameters":[{"name":"campaignId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResumeCampaignRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: QUOTA_EXCEEDED, FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: CAMPAIGN_STATE_CONFLICT, INSTANCE_STATE_CONFLICT, MEDIA_NOT_READY","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Resume a campaign","tags":["Campaigns"]}},"/v1/campaigns/{campaignId}/cancel":{"post":{"description":"Pending recipients are cancelled and queued messages withdrawn. Cannot be undone.","operationId":"Campaigns_cancel","parameters":[{"name":"campaignId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: CAMPAIGN_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Cancel a campaign","tags":["Campaigns"]}},"/v1/campaigns/{campaignId}/duplicate":{"post":{"description":"Creates a new draft with the same audience, message and numbers.","operationId":"Campaigns_duplicate","parameters":[{"name":"campaignId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Duplicate a campaign","tags":["Campaigns"]}},"/v1/campaigns/{campaignId}/test":{"post":{"description":"Sends the rendered message to one contact now. Not counted in the campaign.","operationId":"Campaigns_test","parameters":[{"name":"campaignId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestCampaignRequest"}}}},"responses":{"202":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestCampaignResponse"}}}},"400":{"description":"Error codes: VALIDATION_ERROR, INVALID_RECIPIENT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: QUOTA_EXCEEDED, FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: CONTACT_OPTED_OUT, INSTANCE_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Send a test message","tags":["Campaigns"]}},"/v1/campaigns/{campaignId}/recipients":{"get":{"description":"Delivery status of every contact in the audience snapshot.","operationId":"Campaigns_recipients","parameters":[{"name":"campaignId","required":true,"in":"path","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Page size (1-100).","schema":{"minimum":1,"maximum":100,"default":25,"type":"integer"}},{"name":"cursor","required":false,"in":"query","description":"Opaque cursor from `pagination.nextCursor`.","schema":{"maxLength":200,"type":"string"}},{"name":"status","required":false,"in":"query","schema":{"$ref":"#/components/schemas/CampaignRecipientStatus"}},{"name":"skipReason","required":false,"in":"query","schema":{"$ref":"#/components/schemas/CampaignSkipReason"}}],"responses":{"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignRecipientList"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"List campaign recipients","tags":["Campaigns"]}},"/v1/campaign-settings":{"get":{"description":"Consent mode, pacing between campaign messages, and opt-out/opt-in keywords and replies.","operationId":"CampaignSettings_get","parameters":[],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignSettings"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Get campaign settings","tags":["Campaigns"]},"put":{"description":"Switching to `opt_out` consent mode is only possible from the dashboard by an owner or admin, with an acknowledgement.","operationId":"CampaignSettings_update","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCampaignSettingsRequest"}}}},"responses":{"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FORBIDDEN, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignSettings"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Update campaign settings","tags":["Campaigns"]}},"/v1/followups/sequences":{"get":{"description":"Requires a plan with follow-ups.","operationId":"FollowUpSequences_list","parameters":[{"name":"limit","required":false,"in":"query","description":"Page size (1-100).","schema":{"minimum":1,"maximum":100,"default":25,"type":"integer"}},{"name":"cursor","required":false,"in":"query","description":"Opaque cursor from `pagination.nextCursor`.","schema":{"maxLength":200,"type":"string"}},{"name":"status","required":false,"in":"query","schema":{"$ref":"#/components/schemas/FollowUpSequenceStatus"}},{"name":"kind","required":false,"in":"query","schema":{"$ref":"#/components/schemas/FollowUpKind"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowUpSequenceList"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"List follow-up sequences","tags":["Follow-ups"]},"post":{"description":"Created as a draft; publish it to start enrolling contacts.","operationId":"FollowUpSequences_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFollowUpSequenceRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowUpSequence"}}}},"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FOLLOWUP_LIMIT_REACHED, FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Create a sequence","tags":["Follow-ups"]}},"/v1/followups/sequences/render-preview":{"post":{"description":"Fill contact, enrollment ({{vars.*}}) and anchor ({{anchor.*}}) variables and report missing ones.","operationId":"FollowUpSequences_renderPreview","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowUpPreviewRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenderCampaignPreview"}}}},"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Render a follow-up message","tags":["Follow-ups"]}},"/v1/followups/sequences/{sequenceId}":{"get":{"operationId":"FollowUpSequences_get","parameters":[{"name":"sequenceId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowUpSequence"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Get a sequence","tags":["Follow-ups"]},"patch":{"description":"Changes apply to new enrollments once published; running enrollments keep their version.","operationId":"FollowUpSequences_update","parameters":[{"name":"sequenceId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFollowUpSequenceRequest"}}}},"responses":{"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: CONFLICT, INVALID_TRANSITION","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowUpSequence"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Update a sequence draft","tags":["Follow-ups"]},"delete":{"description":"Published sequences are archived instead.","operationId":"FollowUpSequences_delete","parameters":[{"name":"sequenceId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: INVALID_TRANSITION","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Delete a sequence that never ran","tags":["Follow-ups"]}},"/v1/followups/sequences/{sequenceId}/publish":{"post":{"description":"Snapshots the draft into a new version used by new enrollments. A draft becomes active.","operationId":"FollowUpSequences_publish","parameters":[{"name":"sequenceId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowUpSequence"}}}},"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: INVALID_TRANSITION","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Publish a sequence","tags":["Follow-ups"]}},"/v1/followups/sequences/{sequenceId}/pause":{"post":{"description":"No new enrollments; running enrollments wait until it resumes.","operationId":"FollowUpSequences_pause","parameters":[{"name":"sequenceId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowUpSequence"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: INVALID_TRANSITION","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Pause a sequence","tags":["Follow-ups"]}},"/v1/followups/sequences/{sequenceId}/resume":{"post":{"operationId":"FollowUpSequences_resume","parameters":[{"name":"sequenceId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowUpSequence"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: INVALID_TRANSITION","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Resume a sequence","tags":["Follow-ups"]}},"/v1/followups/sequences/{sequenceId}/archive":{"post":{"description":"Disables its rules; running enrollments finish unless `stopEnrollments` is set.","operationId":"FollowUpSequences_archive","parameters":[{"name":"sequenceId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArchiveFollowUpSequenceRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowUpSequence"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Archive a sequence","tags":["Follow-ups"]}},"/v1/followups/sequences/{sequenceId}/stats":{"get":{"description":"Outcomes of enrollments and a per-step funnel (queued, sent, delivered, read, replied).","operationId":"FollowUpSequences_stats","parameters":[{"name":"sequenceId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowUpStats"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Sequence statistics","tags":["Follow-ups"]}},"/v1/followups/enrollments":{"get":{"operationId":"FollowUpEnrollments_list","parameters":[{"name":"limit","required":false,"in":"query","description":"Page size (1-100).","schema":{"minimum":1,"maximum":100,"default":25,"type":"integer"}},{"name":"cursor","required":false,"in":"query","description":"Opaque cursor from `pagination.nextCursor`.","schema":{"maxLength":200,"type":"string"}},{"name":"sequenceId","required":false,"in":"query","schema":{"type":"string"}},{"name":"status","required":false,"in":"query","schema":{"$ref":"#/components/schemas/FollowUpEnrollmentStatus"}},{"name":"contactId","required":false,"in":"query","schema":{"type":"string"}},{"name":"conversationId","required":false,"in":"query","schema":{"type":"string"}},{"name":"externalReference","required":false,"in":"query","schema":{"maxLength":200,"type":"string"}},{"name":"source","required":false,"in":"query","schema":{"$ref":"#/components/schemas/FollowUpEnrollmentSource"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowUpEnrollmentList"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"List enrollments","tags":["Follow-ups"]},"post":{"description":"Start a sequence (or a one-off `inline` follow-up) for a contact, by id, by phone number (found or created) or by conversation. Reminders need `anchorAt`. Use `dedupeKey` (e.g. \"invoice-551\") to make enrolling the same thing twice return the existing enrollment.","operationId":"FollowUpEnrollments_create","parameters":[{"name":"Idempotency-Key","in":"header","description":"Unique key (max 255 printable ASCII chars). Retrying with the same key and body returns the original response instead of performing the action twice. Keys are kept for 24 hours.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFollowUpEnrollmentRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFollowUpEnrollmentResponse"}}}},"400":{"description":"Error codes: VALIDATION_ERROR, INVALID_RECIPIENT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FOLLOWUP_LIMIT_REACHED, CONTACT_LIMIT_REACHED, FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: CONTACT_OPTED_OUT, FOLLOWUP_SEQUENCE_NOT_ACTIVE, FOLLOWUP_ALREADY_ENROLLED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Enroll a contact","tags":["Follow-ups"]}},"/v1/followups/enrollments/bulk":{"post":{"description":"A contact list (up to 1,000) or a segment, processed in the background. Poll the job for progress.","operationId":"FollowUpEnrollments_bulk","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkFollowUpEnrollRequest"}}}},"responses":{"202":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowUpBulkJob"}}}},"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: FOLLOWUP_SEQUENCE_NOT_ACTIVE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Enroll many contacts","tags":["Follow-ups"]}},"/v1/followups/enrollments/bulk/{jobId}":{"get":{"operationId":"FollowUpEnrollments_getBulk","parameters":[{"name":"jobId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowUpBulkJob"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Get a bulk enrollment job","tags":["Follow-ups"]}},"/v1/followups/enrollments/{enrollmentId}":{"get":{"description":"Includes the history of its steps.","operationId":"FollowUpEnrollments_get","parameters":[{"name":"enrollmentId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowUpEnrollment"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Get an enrollment","tags":["Follow-ups"]},"patch":{"description":"Reschedule (new `anchorAt`), change the time zone or replace the variables of a running enrollment.","operationId":"FollowUpEnrollments_update","parameters":[{"name":"enrollmentId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFollowUpEnrollmentRequest"}}}},"responses":{"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: INVALID_TRANSITION","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowUpEnrollment"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Update an enrollment","tags":["Follow-ups"]}},"/v1/followups/enrollments/{enrollmentId}/pause":{"post":{"operationId":"FollowUpEnrollments_pause","parameters":[{"name":"enrollmentId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowUpEnrollment"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: INVALID_TRANSITION","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Pause an enrollment","tags":["Follow-ups"]}},"/v1/followups/enrollments/{enrollmentId}/resume":{"post":{"operationId":"FollowUpEnrollments_resume","parameters":[{"name":"enrollmentId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowUpEnrollment"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: INVALID_TRANSITION, FOLLOWUP_SEQUENCE_NOT_ACTIVE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Resume an enrollment","tags":["Follow-ups"]}},"/v1/followups/enrollments/{enrollmentId}/cancel":{"post":{"description":"Stops it (reason `manual`); a follow-up message still waiting in the send queue is cancelled.","operationId":"FollowUpEnrollments_cancel","parameters":[{"name":"enrollmentId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowUpEnrollment"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Cancel an enrollment","tags":["Follow-ups"]}},"/v1/followups/rules":{"get":{"operationId":"FollowUpRules_list","parameters":[{"name":"limit","required":false,"in":"query","description":"Page size (1-100).","schema":{"minimum":1,"maximum":100,"default":25,"type":"integer"}},{"name":"cursor","required":false,"in":"query","description":"Opaque cursor from `pagination.nextCursor`.","schema":{"maxLength":200,"type":"string"}},{"name":"sequenceId","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowUpRuleList"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"List enrollment rules","tags":["Follow-ups"]},"post":{"description":"Enroll contacts automatically when a trigger fires (tag added, lead created, keyword...) and they match the conditions.","operationId":"FollowUpRules_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFollowUpRuleRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowUpRule"}}}},"400":{"description":"Error codes: VALIDATION_ERROR, SEGMENT_TOO_COMPLEX","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: FOLLOWUP_SEQUENCE_NOT_ACTIVE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Create an enrollment rule","tags":["Follow-ups"]}},"/v1/followups/rules/{ruleId}":{"get":{"operationId":"FollowUpRules_get","parameters":[{"name":"ruleId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowUpRule"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Get an enrollment rule","tags":["Follow-ups"]},"patch":{"operationId":"FollowUpRules_update","parameters":[{"name":"ruleId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFollowUpRuleRequest"}}}},"responses":{"400":{"description":"Error codes: VALIDATION_ERROR, SEGMENT_TOO_COMPLEX","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: CONFLICT, FOLLOWUP_SEQUENCE_NOT_ACTIVE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowUpRule"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Update an enrollment rule","tags":["Follow-ups"]},"delete":{"operationId":"FollowUpRules_delete","parameters":[{"name":"ruleId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Delete an enrollment rule","tags":["Follow-ups"]}},"/v1/followups/settings":{"get":{"description":"Send window, time zone, per-contact cap, pacing and consent mode of the project.","operationId":"FollowUpRules_getSettings","parameters":[],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowUpSettings"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Get follow-up settings","tags":["Follow-ups"]},"put":{"operationId":"FollowUpRules_updateSettings","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFollowUpSettingsRequest"}}}},"responses":{"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowUpSettings"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Update follow-up settings","tags":["Follow-ups"]}},"/v1/conversations/{conversationId}/followups":{"get":{"operationId":"ConversationFollowUps_list","parameters":[{"name":"conversationId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowUpEnrollmentArray"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Follow-ups of a conversation’s contact","tags":["Follow-ups"]},"post":{"description":"Start a sequence, or a quick follow-up: send a message, or remind the assignee, if the contact has not replied after `afterSeconds`.","operationId":"ConversationFollowUps_create","parameters":[{"name":"conversationId","required":true,"in":"path","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","description":"Unique key (max 255 printable ASCII chars). Retrying with the same key and body returns the original response instead of performing the action twice. Keys are kept for 24 hours.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationFollowUpRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFollowUpEnrollmentResponse"}}}},"400":{"description":"Error codes: VALIDATION_ERROR, INVALID_RECIPIENT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FOLLOWUP_LIMIT_REACHED, CONTACT_LIMIT_REACHED, FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: CONTACT_OPTED_OUT, FOLLOWUP_SEQUENCE_NOT_ACTIVE, FOLLOWUP_ALREADY_ENROLLED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Follow up on a conversation","tags":["Follow-ups"]}},"/v1/leads":{"get":{"description":"Filter by status (`open` for new, working and qualified), qualification, source, owner, score and dates.","operationId":"Leads_list","parameters":[{"name":"limit","required":false,"in":"query","description":"Page size (1-100).","schema":{"minimum":1,"maximum":100,"default":25,"type":"integer"}},{"name":"cursor","required":false,"in":"query","description":"Opaque cursor from `pagination.nextCursor`.","schema":{"maxLength":200,"type":"string"}},{"name":"q","required":false,"in":"query","description":"Search by name, email or phone.","schema":{"maxLength":100,"type":"string"}},{"name":"status","required":false,"in":"query","description":"`open` = new, working or qualified.","schema":{"anyOf":[{"$ref":"#/components/schemas/LeadStatus"},{"type":"string","const":"open"}]}},{"name":"qualification","required":false,"in":"query","schema":{"$ref":"#/components/schemas/QualificationLevel"}},{"name":"source","required":false,"in":"query","schema":{"$ref":"#/components/schemas/LeadSource"}},{"name":"ownerUserId","required":false,"in":"query","description":"A user ID, `me`, or `none` for unassigned leads.","schema":{"type":"string"}},{"name":"companyId","required":false,"in":"query","schema":{"type":"string"}},{"name":"contactId","required":false,"in":"query","schema":{"type":"string"}},{"name":"minScore","required":false,"in":"query","schema":{"minimum":-9007199254740991,"maximum":9007199254740991,"type":"integer"}},{"name":"createdAfter","required":false,"in":"query","schema":{"format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z","type":"string"}},{"name":"createdBefore","required":false,"in":"query","schema":{"format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z","type":"string"}},{"name":"slaBreached","required":false,"in":"query","schema":{"type":"string","enum":["true","false"]}},{"name":"sort","required":false,"in":"query","schema":{"default":"created_desc","type":"string","enum":["created_desc","created_asc","score_desc","last_activity_desc"]}}],"responses":{"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadList"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"List leads","tags":["Leads"]},"post":{"description":"Create a lead for a person (by phone number or contact id). If they already have an open lead it is updated instead (`created: false`): fields set by people are never overwritten. Pass `consent` to record an opt-in with its proof.","operationId":"Leads_create","parameters":[{"name":"Idempotency-Key","in":"header","description":"Unique key (max 255 printable ASCII chars). Retrying with the same key and body returns the original response instead of performing the action twice. Keys are kept for 24 hours.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLeadRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLeadResponse"}}}},"400":{"description":"Error codes: VALIDATION_ERROR, INVALID_RECIPIENT, INVALID_FIELD_VALUE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: LEAD_LIMIT_REACHED, CONTACT_LIMIT_REACHED, FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: CONFLICT, IDEMPOTENCY_KEY_REUSED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Capture a lead","tags":["Leads"]}},"/v1/leads/bulk":{"post":{"description":"Assign, change the status of, or delete up to 500 leads. Each lead succeeds or is reported as skipped.","operationId":"Leads_bulk","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkLeadsRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkResult"}}}},"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Update leads in bulk","tags":["Leads"]}},"/v1/leads/export":{"get":{"description":"The leads matching the list filters (at most 50,000), with custom fields as columns.","operationId":"Leads_export","parameters":[{"name":"limit","required":false,"in":"query","description":"Page size (1-100).","schema":{"minimum":1,"maximum":100,"default":25,"type":"integer"}},{"name":"cursor","required":false,"in":"query","description":"Opaque cursor from `pagination.nextCursor`.","schema":{"maxLength":200,"type":"string"}},{"name":"q","required":false,"in":"query","description":"Search by name, email or phone.","schema":{"maxLength":100,"type":"string"}},{"name":"status","required":false,"in":"query","description":"`open` = new, working or qualified.","schema":{"anyOf":[{"$ref":"#/components/schemas/LeadStatus"},{"type":"string","const":"open"}]}},{"name":"qualification","required":false,"in":"query","schema":{"$ref":"#/components/schemas/QualificationLevel"}},{"name":"source","required":false,"in":"query","schema":{"$ref":"#/components/schemas/LeadSource"}},{"name":"ownerUserId","required":false,"in":"query","description":"A user ID, `me`, or `none` for unassigned leads.","schema":{"type":"string"}},{"name":"companyId","required":false,"in":"query","schema":{"type":"string"}},{"name":"contactId","required":false,"in":"query","schema":{"type":"string"}},{"name":"minScore","required":false,"in":"query","schema":{"minimum":-9007199254740991,"maximum":9007199254740991,"type":"integer"}},{"name":"createdAfter","required":false,"in":"query","schema":{"format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z","type":"string"}},{"name":"createdBefore","required":false,"in":"query","schema":{"format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z","type":"string"}},{"name":"slaBreached","required":false,"in":"query","schema":{"type":"string","enum":["true","false"]}},{"name":"sort","required":false,"in":"query","schema":{"default":"created_desc","type":"string","enum":["created_desc","created_asc","score_desc","last_activity_desc"]}}],"responses":{"400":{"description":"Error codes: VALIDATION_ERROR","content":{"text/csv":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"text/csv":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"text/csv":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"text/csv":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"text/csv":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Export leads as CSV","tags":["Leads"]}},"/v1/leads/{leadId}":{"get":{"operationId":"Leads_get","parameters":[{"name":"leadId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Lead"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Get a lead","tags":["Leads"]},"patch":{"description":"Pass `version` to reject the update (409) when the lead changed since you read it.","operationId":"Leads_update","parameters":[{"name":"leadId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateLeadRequest"}}}},"responses":{"400":{"description":"Error codes: VALIDATION_ERROR, INVALID_FIELD_VALUE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Lead"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Update a lead","tags":["Leads"]},"delete":{"description":"The contact and their conversations are kept.","operationId":"Leads_delete","parameters":[{"name":"leadId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Delete a lead","tags":["Leads"]}},"/v1/leads/{leadId}/status":{"post":{"description":"Qualify, disqualify (with a reason), archive or reopen a lead.","operationId":"Leads_transition","parameters":[{"name":"leadId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransitionLeadRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Lead"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: INVALID_TRANSITION, CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Change the status of a lead","tags":["Leads"]}},"/v1/leads/{leadId}/assign":{"post":{"description":"Set or clear the owner (and team) of a lead.","operationId":"Leads_assign","parameters":[{"name":"leadId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Lead"}}}},"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Assign a lead","tags":["Leads"]}},"/v1/leads/{leadId}/convert":{"post":{"description":"Creates the deal (and optionally a company) and closes the lead as converted, in one step.","operationId":"Leads_convert","parameters":[{"name":"leadId","required":true,"in":"path","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","description":"Unique key (max 255 printable ASCII chars). Retrying with the same key and body returns the original response instead of performing the action twice. Keys are kept for 24 hours.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConvertLeadRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConvertLeadResult"}}}},"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: INVALID_TRANSITION, STAGE_NOT_IN_PIPELINE, CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Convert a lead into a deal","tags":["Leads"]}},"/v1/leads/{leadId}/rescore":{"post":{"operationId":"Leads_rescore","parameters":[{"name":"leadId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Lead"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Recalculate the score of a lead","tags":["Leads"]}},"/v1/leads/{leadId}/ai-extraction":{"post":{"description":"Queue an AI pass over the lead’s WhatsApp conversation. Uses the organization’s AI budget.","operationId":"Leads_extract","parameters":[{"name":"leadId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"202":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiExtractionQueued"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Fill lead fields with AI","tags":["Leads"]}},"/v1/leads/{leadId}/timeline":{"get":{"description":"Activities and notes, newest first.","operationId":"Leads_timeline","parameters":[{"name":"leadId","required":true,"in":"path","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Page size (1-100).","schema":{"minimum":1,"maximum":100,"default":25,"type":"integer"}},{"name":"cursor","required":false,"in":"query","description":"Opaque cursor from `pagination.nextCursor`.","schema":{"maxLength":200,"type":"string"}},{"name":"include","required":false,"in":"query","description":"`all` also includes notes.","schema":{"default":"all","type":"string","enum":["activities","all"]}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmTimeline"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Lead timeline","tags":["Leads"]}},"/v1/deals":{"get":{"operationId":"Deals_list","parameters":[{"name":"limit","required":false,"in":"query","description":"Page size (1-100).","schema":{"minimum":1,"maximum":100,"default":25,"type":"integer"}},{"name":"cursor","required":false,"in":"query","description":"Opaque cursor from `pagination.nextCursor`.","schema":{"maxLength":200,"type":"string"}},{"name":"q","required":false,"in":"query","schema":{"maxLength":100,"type":"string"}},{"name":"pipelineId","required":false,"in":"query","schema":{"type":"string"}},{"name":"stageId","required":false,"in":"query","schema":{"type":"string"}},{"name":"status","required":false,"in":"query","schema":{"$ref":"#/components/schemas/DealStatus"}},{"name":"ownerUserId","required":false,"in":"query","description":"A user ID, `me`, or `none`.","schema":{"type":"string"}},{"name":"companyId","required":false,"in":"query","schema":{"type":"string"}},{"name":"contactId","required":false,"in":"query","schema":{"type":"string"}},{"name":"leadId","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DealList"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"List deals","tags":["Deals"]},"post":{"operationId":"Deals_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDealRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deal"}}}},"400":{"description":"Error codes: VALIDATION_ERROR, INVALID_FIELD_VALUE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: STAGE_NOT_IN_PIPELINE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Create a deal","tags":["Deals"]}},"/v1/deals/board":{"get":{"description":"The deals of a pipeline grouped by stage, in board order, with counts and value totals per stage.","operationId":"Deals_board","parameters":[{"name":"pipelineId","required":false,"in":"query","schema":{"type":"string"}},{"name":"ownerUserId","required":false,"in":"query","schema":{"type":"string"}},{"name":"q","required":false,"in":"query","schema":{"maxLength":100,"type":"string"}},{"name":"perStage","required":false,"in":"query","schema":{"minimum":1,"maximum":200,"default":50,"type":"integer"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DealBoard"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Deal board","tags":["Deals"]}},"/v1/deals/{dealId}":{"get":{"operationId":"Deals_get","parameters":[{"name":"dealId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deal"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Get a deal","tags":["Deals"]},"patch":{"operationId":"Deals_update","parameters":[{"name":"dealId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDealRequest"}}}},"responses":{"400":{"description":"Error codes: VALIDATION_ERROR, INVALID_FIELD_VALUE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deal"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Update a deal","tags":["Deals"]},"delete":{"operationId":"Deals_delete","parameters":[{"name":"dealId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Delete a deal","tags":["Deals"]}},"/v1/deals/{dealId}/move":{"post":{"description":"Move to a stage of its pipeline and position it after another deal. Won and lost stages close the deal.","operationId":"Deals_move","parameters":[{"name":"dealId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoveDealRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deal"}}}},"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: STAGE_NOT_IN_PIPELINE, CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Move a deal","tags":["Deals"]}},"/v1/deals/{dealId}/close":{"post":{"operationId":"Deals_close","parameters":[{"name":"dealId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseDealRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deal"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Mark a deal won or lost","tags":["Deals"]}},"/v1/deals/{dealId}/timeline":{"get":{"operationId":"Deals_timeline","parameters":[{"name":"dealId","required":true,"in":"path","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Page size (1-100).","schema":{"minimum":1,"maximum":100,"default":25,"type":"integer"}},{"name":"cursor","required":false,"in":"query","description":"Opaque cursor from `pagination.nextCursor`.","schema":{"maxLength":200,"type":"string"}},{"name":"include","required":false,"in":"query","description":"`all` also includes notes.","schema":{"default":"all","type":"string","enum":["activities","all"]}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmTimeline"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Deal timeline","tags":["Deals"]}},"/v1/pipelines":{"get":{"description":"Every project has at least one pipeline (\"Sales\" by default).","operationId":"Pipelines_list","parameters":[],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PipelineList"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"List pipelines","tags":["Pipelines"]},"post":{"description":"Without stages, the default stages are used.","operationId":"Pipelines_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePipelineRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pipeline"}}}},"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: PIPELINE_LIMIT_REACHED, FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Create a pipeline","tags":["Pipelines"]}},"/v1/pipelines/{pipelineId}":{"patch":{"description":"Rename, archive, make default, or replace its ordered stage list.","operationId":"Pipelines_update","parameters":[{"name":"pipelineId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePipelineRequest"}}}},"responses":{"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pipeline"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Update a pipeline","tags":["Pipelines"]},"delete":{"operationId":"Pipelines_delete","parameters":[{"name":"pipelineId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Delete an empty pipeline","tags":["Pipelines"]}},"/v1/companies":{"get":{"operationId":"Companies_list","parameters":[{"name":"limit","required":false,"in":"query","description":"Page size (1-100).","schema":{"minimum":1,"maximum":100,"default":25,"type":"integer"}},{"name":"cursor","required":false,"in":"query","description":"Opaque cursor from `pagination.nextCursor`.","schema":{"maxLength":200,"type":"string"}},{"name":"q","required":false,"in":"query","description":"Search by name or domain.","schema":{"maxLength":100,"type":"string"}},{"name":"ownerUserId","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyList"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"List companies","tags":["Companies"]},"post":{"operationId":"Companies_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCompanyRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Company"}}}},"400":{"description":"Error codes: VALIDATION_ERROR, INVALID_FIELD_VALUE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Create a company","tags":["Companies"]}},"/v1/companies/{companyId}":{"get":{"operationId":"Companies_get","parameters":[{"name":"companyId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Company"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Get a company","tags":["Companies"]},"patch":{"operationId":"Companies_update","parameters":[{"name":"companyId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCompanyRequest"}}}},"responses":{"400":{"description":"Error codes: VALIDATION_ERROR, INVALID_FIELD_VALUE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Company"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Update a company","tags":["Companies"]},"delete":{"description":"Its contacts, leads and deals are kept and unlinked.","operationId":"Companies_delete","parameters":[{"name":"companyId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Delete a company","tags":["Companies"]}},"/v1/companies/{companyId}/merge":{"post":{"description":"Contacts, leads and deals move over; the source company is deleted.","operationId":"Companies_merge","parameters":[{"name":"companyId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MergeCompaniesRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Company"}}}},"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Merge a company into this one","tags":["Companies"]}},"/v1/companies/{companyId}/timeline":{"get":{"operationId":"Companies_timeline","parameters":[{"name":"companyId","required":true,"in":"path","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Page size (1-100).","schema":{"minimum":1,"maximum":100,"default":25,"type":"integer"}},{"name":"cursor","required":false,"in":"query","description":"Opaque cursor from `pagination.nextCursor`.","schema":{"maxLength":200,"type":"string"}},{"name":"include","required":false,"in":"query","description":"`all` also includes notes.","schema":{"default":"all","type":"string","enum":["activities","all"]}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmTimeline"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Company timeline","tags":["Companies"]}},"/v1/crm/notes":{"post":{"description":"A note on a lead, deal or company.","operationId":"CrmActivity_createNote","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCrmNoteRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmNote"}}}},"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Add a note","tags":["CRM activities"]}},"/v1/crm/notes/{noteId}":{"patch":{"operationId":"CrmActivity_updateNote","parameters":[{"name":"noteId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCrmNoteRequest"}}}},"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FORBIDDEN, FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmNote"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Edit a note","tags":["CRM activities"]},"delete":{"operationId":"CrmActivity_deleteNote","parameters":[{"name":"noteId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FORBIDDEN, FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Delete a note","tags":["CRM activities"]}},"/v1/crm/tasks":{"get":{"description":"Filter by assignee (`me`), status, due window or subject.","operationId":"CrmActivity_listTasks","parameters":[{"name":"limit","required":false,"in":"query","description":"Page size (1-100).","schema":{"minimum":1,"maximum":100,"default":25,"type":"integer"}},{"name":"cursor","required":false,"in":"query","description":"Opaque cursor from `pagination.nextCursor`.","schema":{"maxLength":200,"type":"string"}},{"name":"assigneeUserId","required":false,"in":"query","description":"A user ID, `me`, or `none`.","schema":{"type":"string"}},{"name":"status","required":false,"in":"query","schema":{"$ref":"#/components/schemas/CrmTaskStatus"}},{"name":"due","required":false,"in":"query","schema":{"type":"string","enum":["overdue","today","upcoming","none"]}},{"name":"subjectType","required":false,"in":"query","schema":{"$ref":"#/components/schemas/CrmSubjectType"}},{"name":"subjectId","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmTaskList"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"List tasks","tags":["CRM activities"]},"post":{"description":"A follow-up (call, WhatsApp, email, meeting, to-do), optionally on a lead, deal or company.","operationId":"CrmActivity_createTask","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCrmTaskRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmTask"}}}},"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Create a task","tags":["CRM activities"]}},"/v1/crm/tasks/{taskId}":{"patch":{"description":"Set `status: done` to complete it.","operationId":"CrmActivity_updateTask","parameters":[{"name":"taskId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCrmTaskRequest"}}}},"responses":{"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmTask"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Update a task","tags":["CRM activities"]},"delete":{"operationId":"CrmActivity_deleteTask","parameters":[{"name":"taskId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Delete a task","tags":["CRM activities"]}},"/v1/crm/settings":{"get":{"description":"Capture mode, AI, qualification thresholds, SLA, assignment and visibility.","operationId":"CrmAdmin_getSettings","parameters":[],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmSettings"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Get CRM settings","tags":["CRM settings"]},"patch":{"operationId":"CrmAdmin_updateSettings","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCrmSettingsRequest"}}}},"responses":{"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmSettings"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Update CRM settings","tags":["CRM settings"]}},"/v1/crm/fields":{"get":{"description":"Custom fields of leads, deals and companies.","operationId":"CrmAdmin_listFields","parameters":[{"name":"includeArchived","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmFieldDefinitionList"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"List custom fields","tags":["CRM settings"]},"post":{"operationId":"CrmAdmin_createField","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCrmFieldRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmFieldDefinition"}}}},"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error codes: CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Create a custom field","tags":["CRM settings"]}},"/v1/crm/fields/{fieldId}":{"patch":{"description":"The key and type are fixed; archive a field instead of deleting it.","operationId":"CrmAdmin_updateField","parameters":[{"name":"fieldId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCrmFieldRequest"}}}},"responses":{"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmFieldDefinition"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Update a custom field","tags":["CRM settings"]}},"/v1/crm/scoring-rules":{"get":{"operationId":"CrmAdmin_listScoring","parameters":[],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScoringRuleList"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"List scoring rules","tags":["CRM settings"]},"post":{"description":"Points added to every lead matching the condition. Open leads are rescored in the background.","operationId":"CrmAdmin_createScoring","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateScoringRuleRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScoringRule"}}}},"400":{"description":"Error codes: VALIDATION_ERROR, RULE_TOO_COMPLEX","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Create a scoring rule","tags":["CRM settings"]}},"/v1/crm/scoring-rules/preview":{"post":{"description":"Score recent open leads with the current (or draft) rules without saving anything.","operationId":"CrmAdmin_previewScoring","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScoringPreviewRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScoringPreview"}}}},"400":{"description":"Error codes: VALIDATION_ERROR, RULE_TOO_COMPLEX","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Preview scoring","tags":["CRM settings"]}},"/v1/crm/scoring-rules/{ruleId}":{"patch":{"operationId":"CrmAdmin_updateScoring","parameters":[{"name":"ruleId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateScoringRuleRequest"}}}},"responses":{"400":{"description":"Error codes: VALIDATION_ERROR, RULE_TOO_COMPLEX","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScoringRule"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Update a scoring rule","tags":["CRM settings"]},"delete":{"operationId":"CrmAdmin_deleteScoring","parameters":[{"name":"ruleId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Delete a scoring rule","tags":["CRM settings"]}},"/v1/crm/assignment-rules":{"get":{"description":"Evaluated in order; the first matching rule picks the owner of a new lead.","operationId":"CrmAdmin_listAssignment","parameters":[],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentRuleList"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"List assignment rules","tags":["CRM settings"]},"post":{"operationId":"CrmAdmin_createAssignment","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAssignmentRuleRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentRule"}}}},"400":{"description":"Error codes: VALIDATION_ERROR, RULE_TOO_COMPLEX","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Create an assignment rule","tags":["CRM settings"]}},"/v1/crm/assignment-rules/{ruleId}":{"patch":{"operationId":"CrmAdmin_updateAssignment","parameters":[{"name":"ruleId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAssignmentRuleRequest"}}}},"responses":{"400":{"description":"Error codes: VALIDATION_ERROR, RULE_TOO_COMPLEX","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentRule"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Update an assignment rule","tags":["CRM settings"]},"delete":{"operationId":"CrmAdmin_deleteAssignment","parameters":[{"name":"ruleId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Delete an assignment rule","tags":["CRM settings"]}},"/v1/crm/reports":{"get":{"description":"Funnel, sources, speed-to-lead, pipeline value, win rate, forecast and owners for a period (max 366 days).","operationId":"CrmAdmin_report","parameters":[{"name":"from","required":false,"in":"query","description":"Inclusive start (UTC), default 30 days ago.","schema":{"format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","type":"string"}},{"name":"to","required":false,"in":"query","description":"Inclusive end (UTC), default today.","schema":{"format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","type":"string"}},{"name":"pipelineId","required":false,"in":"query","schema":{"type":"string"}},{"name":"ownerUserId","required":false,"in":"query","schema":{"type":"string"}},{"name":"source","required":false,"in":"query","schema":{"$ref":"#/components/schemas/LeadSource"}}],"responses":{"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmReport"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"CRM report","tags":["CRM settings"]}},"/v1/lead-forms":{"get":{"operationId":"LeadForms_list","parameters":[{"name":"limit","required":false,"in":"query","description":"Page size (1-100).","schema":{"minimum":1,"maximum":100,"default":25,"type":"integer"}},{"name":"cursor","required":false,"in":"query","description":"Opaque cursor from `pagination.nextCursor`.","schema":{"maxLength":200,"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadFormList"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"List lead forms","tags":["Lead capture"]},"post":{"description":"A hosted page and embeddable form whose submissions become leads.","operationId":"LeadForms_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLeadFormRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadForm"}}}},"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FORM_LIMIT_REACHED, FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Create a lead form","tags":["Lead capture"]}},"/v1/lead-forms/{formId}":{"get":{"operationId":"LeadForms_get","parameters":[{"name":"formId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadForm"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Get a lead form","tags":["Lead capture"]},"patch":{"operationId":"LeadForms_update","parameters":[{"name":"formId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateLeadFormRequest"}}}},"responses":{"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadForm"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Update a lead form","tags":["Lead capture"]},"delete":{"operationId":"LeadForms_delete","parameters":[{"name":"formId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Delete a lead form","tags":["Lead capture"]}},"/v1/lead-links":{"get":{"operationId":"LeadLinks_list","parameters":[{"name":"limit","required":false,"in":"query","description":"Page size (1-100).","schema":{"minimum":1,"maximum":100,"default":25,"type":"integer"}},{"name":"cursor","required":false,"in":"query","description":"Opaque cursor from `pagination.nextCursor`.","schema":{"maxLength":200,"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadLinkList"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"List click-to-chat links","tags":["Lead capture"]},"post":{"description":"A short link (and QR code) that opens WhatsApp with a prefilled message. Leads from it are attributed to the link and its UTM tags.","operationId":"LeadLinks_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLeadLinkRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadLink"}}}},"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Create a click-to-chat link","tags":["Lead capture"]}},"/v1/lead-links/{linkId}":{"patch":{"operationId":"LeadLinks_update","parameters":[{"name":"linkId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateLeadLinkRequest"}}}},"responses":{"400":{"description":"Error codes: VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadLink"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Update a click-to-chat link","tags":["Lead capture"]},"delete":{"operationId":"LeadLinks_delete","parameters":[{"name":"linkId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"401":{"description":"Error codes: UNAUTHENTICATED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error codes: FEATURE_NOT_AVAILABLE, INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error codes: NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error codes: RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Error codes: INTERNAL_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"apiKey":[]},{"apiKey":[]}],"summary":"Delete a click-to-chat link","tags":["Lead capture"]}}},"info":{"title":"WhatsTIG API","description":"WhatsTIG connects WhatsApp accounts and lets your applications send and receive messages through a REST API and signed webhooks.\n\n**Important:** WhatsTIG uses an unofficial WhatsApp Web protocol implementation (Baileys). It is not affiliated with,\nauthorized or endorsed by WhatsApp or Meta. Accounts can be restricted by WhatsApp, the protocol can change, and delivery\nis never guaranteed. Only message people who expect to hear from you. Read the acceptable-use policy.\n\n### Authentication\nSend your project API key as a bearer token: `Authorization: Bearer wt_live_...`. Keys are scoped to one project.\n\n### Asynchronous model\nSending returns `202 QUEUED` once the message is durably stored. Track it via `GET /v1/messages/{id}` or `message.*` webhooks.\n\n### Errors\nEvery error uses the envelope `{ \"error\": { \"code\", \"message\", \"details\", \"requestId\" } }`.","version":"1.0.0","contact":{}},"tags":[{"name":"Instances","description":"Link WhatsApp accounts and manage their connection."},{"name":"Messages","description":"Send messages and track their delivery status."},{"name":"Media","description":"Upload images and documents to send."},{"name":"Webhooks","description":"Receive signed event notifications."},{"name":"Events","description":"Inspect every emitted event."},{"name":"API keys","description":"Manage project API keys."},{"name":"Usage","description":"Usage statistics and plan limits."},{"name":"Follow-ups","description":"Automated follow-up sequences and reminders: sequences, enrollments, rules and settings."},{"name":"Project","description":"The project an API key belongs to."}],"servers":[{"url":"https://api.whatstig.com"}],"components":{"securitySchemes":{"apiKey":{"scheme":"bearer","bearerFormat":"wt_live_<keyId>_<secret>","type":"http","description":"Project API key"}},"schemas":{"Address":{"type":"object","properties":{"line1":{"type":"string","maxLength":200},"line2":{"type":"string","maxLength":200},"city":{"type":"string","maxLength":100},"region":{"type":"string","maxLength":100},"postalCode":{"type":"string","maxLength":20},"country":{"type":"string","pattern":"^[A-Z]{2}$"}}},"Address_Output":{"type":"object","properties":{"line1":{"type":"string","maxLength":200},"line2":{"type":"string","maxLength":200},"city":{"type":"string","maxLength":100},"region":{"type":"string","maxLength":100},"postalCode":{"type":"string","maxLength":20},"country":{"type":"string","pattern":"^[A-Z]{2}$"}},"additionalProperties":false},"AiExtractionQueued":{"type":"object","properties":{"queued":{"type":"boolean"}},"required":["queued"],"additionalProperties":false},"ApiKey":{"type":"object","properties":{"id":{"type":"string","example":"key_01jq8x7y2z3a4b5c6d7e8f9g0h"},"projectId":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string","description":"Non-secret identifying prefix, safe to display.","example":"wt_live_k7d2m9q4"},"scopes":{"type":"array","items":{"type":"string"}},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"revokedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"lastUsedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["id","projectId","name","prefix","scopes","expiresAt","revokedAt","lastUsedAt","createdAt"],"additionalProperties":false},"ApiKeyList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}}},"required":["data"],"additionalProperties":false},"ApiKeyWithSecret":{"type":"object","properties":{"id":{"type":"string","example":"key_01jq8x7y2z3a4b5c6d7e8f9g0h"},"projectId":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string","description":"Non-secret identifying prefix, safe to display.","example":"wt_live_k7d2m9q4"},"scopes":{"type":"array","items":{"type":"string"}},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"revokedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"lastUsedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"secret":{"type":"string","description":"Full API key. Shown only once. Store it in a server-side secret manager.","example":"wt_live_k7d2m9q4_2bX9..."}},"required":["id","projectId","name","prefix","scopes","expiresAt","revokedAt","lastUsedAt","createdAt","secret"],"additionalProperties":false},"ArchiveFollowUpSequenceRequest":{"type":"object","properties":{"stopEnrollments":{"default":false,"description":"Also stop running enrollments (otherwise they finish).","type":"boolean"}}},"AssignmentRule":{"type":"object","properties":{"id":{"type":"string","example":"arl_01jq8x7y2z3a4b5c6d7e8f9g0h"},"name":{"type":"string"},"condition":{"$ref":"#/components/schemas/LeadRule_Output"},"strategy":{"$ref":"#/components/schemas/AssignmentStrategy"},"targetUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"targetTeamId":{"anyOf":[{"type":"string"},{"type":"null"}]},"active":{"type":"boolean"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["id","name","condition","strategy","targetUserId","targetTeamId","active","position","createdAt","updatedAt"],"additionalProperties":false},"AssignmentRuleList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AssignmentRule"}}},"required":["data"],"additionalProperties":false},"AssignmentStrategy":{"type":"string","enum":["user","team_round_robin","team_least_busy","project_round_robin","conversation_assignee"]},"AssignRequest":{"type":"object","properties":{"ownerUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"teamId":{"anyOf":[{"type":"string"},{"type":"null"}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["ownerUserId"]},"BatchUpsertContactsRequest":{"type":"object","properties":{"contacts":{"minItems":1,"maxItems":1000,"type":"array","items":{"$ref":"#/components/schemas/UpsertContactRequest"}}},"required":["contacts"]},"BatchUpsertContactsResponse":{"type":"object","properties":{"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updated":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"results":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"contactId":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["created","updated","failed"]},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false},{"type":"null"}]}},"required":["index","contactId","status","error"],"additionalProperties":false}}},"required":["created","updated","failed","results"],"additionalProperties":false},"BulkContactTagsRequest":{"type":"object","properties":{"contactIds":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string"}},"segmentId":{"type":"string"},"add":{"default":[],"maxItems":20,"type":"array","items":{"type":"string"}},"remove":{"default":[],"maxItems":20,"type":"array","items":{"type":"string"}}}},"BulkContactTagsResponse":{"type":"object","properties":{"matched":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["matched"],"additionalProperties":false},"BulkFollowUpEnrollRequest":{"type":"object","properties":{"sequenceId":{"type":"string"},"contactIds":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string"}},"segmentId":{"type":"string"},"variables":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z0-9_]{1,64}$"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}]},"description":"Values for {{vars.<key>}} in messages, e.g. { \"invoiceNo\": \"INV-551\", \"amount\": \"PKR 12,000\" }."},"anchorAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"instanceId":{"type":"string"}},"required":["sequenceId"]},"BulkLeadsRequest":{"type":"object","properties":{"leadIds":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string"}},"action":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"assign"},"ownerUserId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["type","ownerUserId"]},{"type":"object","properties":{"type":{"type":"string","const":"status"},"status":{"type":"string","enum":["new","working","qualified","unqualified","archived"]},"reason":{"type":"string","maxLength":500}},"required":["type","status"]},{"type":"object","properties":{"type":{"type":"string","const":"delete"}},"required":["type"]}]}},"required":["leadIds","action"]},"BulkResult":{"type":"object","properties":{"updated":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string"}},"required":["id","reason"],"additionalProperties":false}}},"required":["updated","skipped"],"additionalProperties":false},"Campaign":{"type":"object","properties":{"id":{"type":"string","example":"cmp_01jq8x7y2z3a4b5c6d7e8f9g0h"},"projectId":{"type":"string"},"name":{"type":"string"},"status":{"$ref":"#/components/schemas/CampaignStatus"},"pauseReason":{"anyOf":[{"$ref":"#/components/schemas/CampaignPauseReason"},{"type":"null"}]},"failureReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"segmentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"audience":{"anyOf":[{"$ref":"#/components/schemas/SegmentRule_Output"},{"type":"null"}],"description":"Inline audience rule (or the segment rule frozen at launch)."},"message":{"anyOf":[{"$ref":"#/components/schemas/CampaignMessage_Output"},{"type":"null"}]},"instanceIds":{"type":"array","items":{"type":"string"}},"instanceStrategy":{"$ref":"#/components/schemas/CampaignInstanceStrategy"},"sendDelayMs":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Overrides the project setting for this campaign."},"messageTtlSeconds":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"skipIfMissingVariables":{"type":"boolean"},"consentMode":{"anyOf":[{"$ref":"#/components/schemas/ConsentMode"},{"type":"null"}],"description":"Consent mode in effect when the campaign started."},"scheduledAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"followUpSequenceId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"No-reply follow-up sequence that non-responders are enrolled in."},"stats":{"$ref":"#/components/schemas/CampaignStats"},"launchedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"startedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"pausedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"cancelledAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["id","projectId","name","status","pauseReason","failureReason","segmentId","audience","message","instanceIds","instanceStrategy","sendDelayMs","messageTtlSeconds","skipIfMissingVariables","consentMode","scheduledAt","timezone","followUpSequenceId","stats","launchedAt","startedAt","pausedAt","completedAt","cancelledAt","version","createdAt","updatedAt"],"additionalProperties":false},"CampaignInstanceStrategy":{"type":"string","enum":["single","round_robin","sticky"],"description":"`single`: one number. `round_robin`: spread recipients evenly (stable per contact). `sticky`: use the number the contact last talked to, else round robin."},"CampaignList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Campaign"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"],"additionalProperties":false},"CampaignMessage":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"content":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":4096}},"required":["text"]}},"required":["type","content"]},{"type":"object","properties":{"type":{"type":"string","const":"image"},"content":{"type":"object","properties":{"mediaId":{"type":"string","description":"ID returned by POST /v1/media."},"caption":{"type":"string","maxLength":1024}},"required":["mediaId"]}},"required":["type","content"]},{"type":"object","properties":{"type":{"type":"string","const":"document"},"content":{"type":"object","properties":{"mediaId":{"type":"string","description":"ID returned by POST /v1/media."},"fileName":{"description":"File name shown to the recipient.","type":"string","minLength":1,"maxLength":200},"caption":{"type":"string","maxLength":1024}},"required":["mediaId"]}},"required":["type","content"]}],"description":"Text and captions may use variables: {{contact.name}}, {{contact.firstName}}, {{contact.displayName}}, {{contact.phone}}, {{attr.<key>}}, each with an optional fallback: {{contact.firstName | \"there\"}}."},"CampaignMessage_Output":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"content":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":4096}},"required":["text"],"additionalProperties":false}},"required":["type","content"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"image"},"content":{"type":"object","properties":{"mediaId":{"type":"string","description":"ID returned by POST /v1/media."},"caption":{"type":"string","maxLength":1024}},"required":["mediaId"],"additionalProperties":false}},"required":["type","content"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"document"},"content":{"type":"object","properties":{"mediaId":{"type":"string","description":"ID returned by POST /v1/media."},"fileName":{"description":"File name shown to the recipient.","type":"string","minLength":1,"maxLength":200},"caption":{"type":"string","maxLength":1024}},"required":["mediaId"],"additionalProperties":false}},"required":["type","content"],"additionalProperties":false}],"description":"Text and captions may use variables: {{contact.name}}, {{contact.firstName}}, {{contact.displayName}}, {{contact.phone}}, {{attr.<key>}}, each with an optional fallback: {{contact.firstName | \"there\"}}."},"CampaignPauseReason":{"type":"string","enum":["user","instance_logged_out","instance_restricted","instance_disconnected","instance_deleted","quota_exceeded","media_unavailable","plan_changed"]},"CampaignRecipient":{"type":"object","properties":{"id":{"type":"string"},"contactId":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"instanceId":{"type":"string"},"status":{"$ref":"#/components/schemas/CampaignRecipientStatus"},"skipReason":{"anyOf":[{"$ref":"#/components/schemas/CampaignSkipReason"},{"type":"null"}]},"failureCode":{"anyOf":[{"$ref":"#/components/schemas/MessageFailureCode"},{"type":"null"}]},"messageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"queuedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"sentAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"deliveredAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"readAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"failedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["id","contactId","phone","instanceId","status","skipReason","failureCode","messageId","queuedAt","sentAt","deliveredAt","readAt","failedAt","createdAt"],"additionalProperties":false},"CampaignRecipientList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CampaignRecipient"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"],"additionalProperties":false},"CampaignRecipientStatus":{"type":"string","enum":["pending","queued","sent","delivered","read","failed","unknown","skipped","cancelled"]},"CampaignSettings":{"type":"object","properties":{"consentMode":{"default":"opt_in","description":"`opt_in`: only contacts with a recorded opt-in receive campaigns. `opt_out`: everyone except opted-out contacts.","$ref":"#/components/schemas/ConsentMode"},"sendDelayMs":{"type":"integer","default":3000,"description":"Minimum gap between two campaign messages on the same WhatsApp number. Plan and number limits still apply.","minimum":0,"maximum":600000},"optOutKeywords":{"type":"array","default":["stop","stopall","unsubscribe","optout","opt out","opt-out","baja","parar","stopp","abmelden","arrêt","désabonner","إلغاء","الغاء","توقف","بند کریں","रोकें"],"maxItems":30,"items":{"type":"string","minLength":1,"maxLength":40}},"optInKeywords":{"type":"array","default":["start","unstop","subscribe","optin","opt in","opt-in","alta","iniciar","abonnieren","اشتراك","شروع","शुरू"],"maxItems":30,"items":{"type":"string","minLength":1,"maxLength":40}},"optOutReply":{"type":"object","default":{"enabled":true,"text":"You have been unsubscribed and will not receive further messages. Reply START to subscribe again."},"properties":{"enabled":{"type":"boolean"},"text":{"type":"string","minLength":1,"maxLength":500}},"required":["enabled","text"],"additionalProperties":false},"optInReply":{"type":"object","default":{"enabled":true,"text":"You are subscribed again. Reply STOP to unsubscribe."},"properties":{"enabled":{"type":"boolean"},"text":{"type":"string","minLength":1,"maxLength":500}},"required":["enabled","text"],"additionalProperties":false},"defaultMessageTtlSeconds":{"type":"integer","default":86400,"minimum":300,"maximum":604800}},"required":["consentMode","sendDelayMs","optOutKeywords","optInKeywords","optOutReply","optInReply","defaultMessageTtlSeconds"],"additionalProperties":false},"CampaignSkipReason":{"type":"string","enum":["opted_out","no_consent","no_address","invalid","duplicate","contact_deleted","missing_variable"]},"CampaignStats":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"pending":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Sent but not (yet) delivered."},"delivered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Delivered but not (yet) read."},"read":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unknown":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cancelled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skippedByReason":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"updatedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]}},"required":["total","pending","queued","sent","delivered","read","failed","unknown","skipped","cancelled","skippedByReason","updatedAt"],"additionalProperties":false},"CampaignStatus":{"type":"string","enum":["draft","scheduled","running","paused","completed","cancelled","failed"]},"CloseDealRequest":{"type":"object","properties":{"status":{"type":"string","enum":["won","lost"]},"lostReason":{"type":"string","maxLength":500},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["status"]},"Company":{"type":"object","properties":{"id":{"type":"string","example":"co_01jq8x7y2z3a4b5c6d7e8f9g0h"},"projectId":{"type":"string"},"name":{"type":"string"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}]},"industry":{"anyOf":[{"type":"string"},{"type":"null"}]},"size":{"anyOf":[{"type":"string","enum":["1-10","11-50","51-200","201-500","501-1000","1001-5000","5000+"]},{"type":"null"}]},"website":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"address":{"anyOf":[{"$ref":"#/components/schemas/Address_Output"},{"type":"null"}]},"ownerUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"externalId":{"anyOf":[{"type":"string"},{"type":"null"}]},"counts":{"type":"object","properties":{"contacts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"openLeads":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"openDeals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["contacts","openLeads","openDeals"],"additionalProperties":false},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["id","projectId","name","domain","industry","size","website","phone","address","ownerUserId","customFields","externalId","version","createdAt","updatedAt"],"additionalProperties":false},"CompanyList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Company"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"],"additionalProperties":false},"ConnectInstanceRequest":{"type":"object","properties":{"method":{"default":"qr","description":"`qr` returns a QR to scan. `pairing_code` returns an 8-character code to type on the phone.","type":"string","enum":["qr","pairing_code"]},"phoneNumber":{"description":"Required for `pairing_code`: the number of the account being linked, in international format.","type":"string","maxLength":32}}},"ConnectSession":{"type":"object","properties":{"id":{"type":"string"},"instanceId":{"type":"string"},"url":{"type":"string","format":"uri","description":"Single-instance, short-lived URL of the hosted connect page. Treat it like a secret."},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["id","instanceId","url","expiresAt"],"additionalProperties":false},"ConsentEvent":{"type":"object","properties":{"id":{"type":"string"},"status":{"$ref":"#/components/schemas/ConsentStatus"},"source":{"$ref":"#/components/schemas/ConsentSource"},"proof":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"actor":{"type":"object","properties":{"type":{"type":"string","enum":["user","api_key","system","contact"]},"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["type","id","label"],"additionalProperties":false},"messageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["id","status","source","proof","actor","messageId","createdAt"],"additionalProperties":false},"ConsentEventList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ConsentEvent"}}},"required":["data"],"additionalProperties":false},"ConsentInput":{"type":"object","properties":{"status":{"type":"string","const":"opted_in"},"source":{"type":"string","enum":["api","form","import","dashboard","other"]},"proof":{"$ref":"#/components/schemas/ConsentProof"}},"required":["status"]},"ConsentMode":{"type":"string","enum":["opt_in","opt_out"]},"ConsentProof":{"type":"object","properties":{"text":{"description":"What the person agreed to, e.g. the checkbox wording.","type":"string","maxLength":1000},"url":{"description":"Where consent was collected.","type":"string","maxLength":2048,"format":"uri"},"ip":{"type":"string","maxLength":64},"capturedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}}},"ConsentSource":{"type":"string","enum":["api","import","dashboard","inbound_keyword","form","suppression","other"]},"ConsentStatus":{"type":"string","enum":["unknown","opted_in","opted_out"]},"Contact":{"type":"object","properties":{"id":{"type":"string","example":"ct_01jq8x7y2z3a4b5c6d7e8f9g0h"},"projectId":{"type":"string"},"name":{"type":"string","description":"Display name, else the WhatsApp profile name, else the phone number."},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Name set by your team."},"pushName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Name from the contact’s WhatsApp profile."},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"E.164 digits when known (WhatsApp may hide it behind a LID)."},"externalId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Your own identifier for this person."},"attributes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"tags":{"type":"array","items":{"$ref":"#/components/schemas/Tag"}},"consent":{"$ref":"#/components/schemas/ContactConsent"},"source":{"anyOf":[{"type":"string","enum":["whatsapp","api","import","dashboard"]},{"type":"null"}],"description":"How the contact was first added."},"lastInboundAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}],"description":"Last message received from this contact."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["id","projectId","name","displayName","pushName","phone","externalId","attributes","notes","tags","consent","source","lastInboundAt","createdAt","updatedAt"],"additionalProperties":false},"ContactConsent":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/ConsentStatus"},"source":{"anyOf":[{"$ref":"#/components/schemas/ConsentSource"},{"type":"null"}]},"at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}],"description":"When the current consent status was recorded."},"optedOutAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]}},"required":["status","source","at","optedOutAt"],"additionalProperties":false},"ContactImport":{"type":"object","properties":{"id":{"type":"string","example":"imp_01jq8x7y2z3a4b5c6d7e8f9g0h"},"projectId":{"type":"string"},"status":{"type":"string","enum":["queued","processing","completed","failed","cancelled"]},"fileName":{"type":"string"},"sizeBytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"options":{"$ref":"#/components/schemas/ContactImportOptions"},"totalRows":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"processedRows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updatedCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skippedCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"errorCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"startedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]}},"required":["id","projectId","status","fileName","sizeBytes","options","totalRows","processedRows","createdCount","updatedCount","skippedCount","errorCount","error","createdAt","startedAt","completedAt"],"additionalProperties":false},"ContactImportError":{"type":"object","properties":{"rowNumber":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"code":{"type":"string"},"message":{"type":"string"},"raw":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["rowNumber","code","message","raw"],"additionalProperties":false},"ContactImportErrorList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ContactImportError"}}},"required":["data"],"additionalProperties":false},"ContactImportList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ContactImport"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"],"additionalProperties":false},"ContactImportMapping":{"type":"object","properties":{"phone":{"type":"string","minLength":1,"maxLength":100},"displayName":{"type":"string","maxLength":100},"externalId":{"type":"string","maxLength":100},"attributes":{"default":{},"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"string","maxLength":100}},"tags":{"type":"object","properties":{"column":{"type":"string","maxLength":100},"separator":{"default":";","type":"string","minLength":1,"maxLength":3}},"required":["column","separator"],"additionalProperties":false}},"required":["phone","attributes"],"additionalProperties":false},"ContactImportOptions":{"type":"object","properties":{"mapping":{"$ref":"#/components/schemas/ContactImportMapping"},"tagIds":{"default":[],"description":"Tags added to every imported contact.","maxItems":20,"type":"array","items":{"type":"string"}},"consent":{"type":"object","properties":{"text":{"type":"string","minLength":10,"maxLength":1000},"url":{"type":"string","maxLength":2048,"format":"uri"}},"required":["text"],"additionalProperties":false},"updateExisting":{"default":true,"type":"boolean"},"lead":{"type":"object","properties":{"ownerUserId":{"type":"string"},"label":{"description":"Source label, e.g. \"Trade show 2026\".","type":"string","maxLength":200},"columns":{"default":{},"type":"object","properties":{"firstName":{"type":"string","maxLength":100},"lastName":{"type":"string","maxLength":100},"email":{"type":"string","maxLength":100},"title":{"type":"string","maxLength":100},"company":{"type":"string","maxLength":100}},"additionalProperties":false},"fields":{"default":{},"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"additionalProperties":{"type":"string","maxLength":100}}},"required":["columns","fields"],"additionalProperties":false},"defaultCountryCode":{"description":"For numbers without a country code. Defaults to the project setting.","type":"string","pattern":"^[A-Z]{2}$"}},"required":["mapping","tagIds","updateExisting"],"additionalProperties":false},"ContactList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Contact"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"],"additionalProperties":false},"Conversation":{"type":"object","properties":{"id":{"type":"string","example":"cnv_01jq8x7y2z3a4b5c6d7e8f9g0h"},"projectId":{"type":"string"},"instanceId":{"type":"string"},"contact":{"type":"object","properties":{"id":{"type":"string","example":"ct_01jq8x7y2z3a4b5c6d7e8f9g0h"},"name":{"type":"string","description":"Display name, else the WhatsApp profile name, else the phone number."},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"E.164 digits when known (WhatsApp may hide it behind a LID)."},"pushName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Name from the contact’s WhatsApp profile."},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Name set by your team."}},"required":["id","name","phone","pushName","displayName"],"additionalProperties":false},"status":{"$ref":"#/components/schemas/ConversationStatus"},"priority":{"$ref":"#/components/schemas/ConversationPriority"},"assignee":{"anyOf":[{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"}},"required":["userId","name"],"additionalProperties":false},{"type":"null"}]},"teamId":{"anyOf":[{"type":"string"},{"type":"null"}]},"tags":{"type":"array","items":{"$ref":"#/components/schemas/Tag"}},"snoozedUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"lastMessageAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"lastMessagePreview":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Omitted once message content retention expires."},"lastMessageDirection":{"anyOf":[{"type":"string","enum":["inbound","outbound"]},{"type":"null"}]},"lastInboundAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"lastOutboundAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"firstResponseDueAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"nextResponseDueAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"slaBreachedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"unread":{"type":"boolean","description":"Dashboard only: new inbound messages since the caller last opened it."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Pass back in PATCH to detect concurrent changes."},"resolvedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["id","projectId","instanceId","contact","status","priority","assignee","teamId","tags","snoozedUntil","lastMessageAt","lastMessagePreview","lastMessageDirection","lastInboundAt","lastOutboundAt","firstResponseDueAt","nextResponseDueAt","slaBreachedAt","unread","version","resolvedAt","createdAt","updatedAt"],"additionalProperties":false},"ConversationFollowUpRequest":{"type":"object","properties":{"sequenceId":{"type":"string"},"quick":{"type":"object","properties":{"type":{"type":"string","enum":["message","reminder"],"description":"`message`: send `text` if the contact has not replied. `reminder`: notify the assignee."},"afterSeconds":{"type":"integer","minimum":60,"maximum":7776000},"text":{"type":"string","minLength":1,"maxLength":4096}},"required":["type","afterSeconds","text"]},"variables":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z0-9_]{1,64}$"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}]},"description":"Values for {{vars.<key>}} in messages, e.g. { \"invoiceNo\": \"INV-551\", \"amount\": \"PKR 12,000\" }."}}},"ConversationList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Conversation"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"],"additionalProperties":false},"ConversationPriority":{"type":"string","enum":["low","normal","high","urgent"]},"ConversationReplyRequest":{"oneOf":[{"type":"object","properties":{"lastSeenMessageId":{"description":"Latest message the agent saw. If a teammate replied after it, the request fails with REPLY_COLLISION.","type":"string"},"force":{"description":"Send even if a teammate replied in the meantime.","type":"boolean"},"type":{"type":"string","const":"text"},"content":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":4096,"example":"Your child was marked absent today."}},"required":["text"]}},"required":["type","content"]},{"type":"object","properties":{"lastSeenMessageId":{"description":"Latest message the agent saw. If a teammate replied after it, the request fails with REPLY_COLLISION.","type":"string"},"force":{"description":"Send even if a teammate replied in the meantime.","type":"boolean"},"type":{"type":"string","const":"image"},"content":{"type":"object","properties":{"mediaId":{"type":"string","description":"ID returned by POST /v1/media."},"caption":{"type":"string","maxLength":1024}},"required":["mediaId"]}},"required":["type","content"]},{"type":"object","properties":{"lastSeenMessageId":{"description":"Latest message the agent saw. If a teammate replied after it, the request fails with REPLY_COLLISION.","type":"string"},"force":{"description":"Send even if a teammate replied in the meantime.","type":"boolean"},"type":{"type":"string","const":"document"},"content":{"type":"object","properties":{"mediaId":{"type":"string","description":"ID returned by POST /v1/media."},"fileName":{"description":"File name shown to the recipient.","type":"string","minLength":1,"maxLength":200},"caption":{"type":"string","maxLength":1024}},"required":["mediaId"]}},"required":["type","content"]}]},"ConversationStatus":{"type":"string","enum":["open","pending","snoozed","resolved"]},"ConversationTimeline":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TimelineItem"},"description":"Oldest first."},"pagination":{"type":"object","properties":{"before":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["before","hasMore"],"additionalProperties":false}},"required":["data","pagination"],"additionalProperties":false},"ConvertLeadRequest":{"type":"object","properties":{"deal":{"default":{},"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"pipelineId":{"type":"string"},"stageId":{"type":"string"},"valueMinor":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Amount in the currency’s minor unit (cents for USD).","example":250000},"currency":{"type":"string","pattern":"^[A-Z]{3}$","example":"USD"},"expectedCloseDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"ownerUserId":{"type":"string"}}},"companyId":{"type":"string"},"company":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"domain":{"type":"string","maxLength":253,"pattern":"^(?=.{1,253}$)([a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$"}},"required":["name"]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}},"ConvertLeadResult":{"type":"object","properties":{"lead":{"$ref":"#/components/schemas/Lead"},"deal":{"$ref":"#/components/schemas/Deal"}},"required":["lead","deal"],"additionalProperties":false},"CreateApiKeyRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"example":"Edutig production backend"},"scopes":{"minItems":1,"type":"array","items":{"type":"string","enum":["instances:read","instances:write","messages:read","messages:send","media:read","media:write","webhooks:read","webhooks:write","events:read","usage:read","keys:read","keys:write","conversations:read","conversations:write","contacts:read","contacts:write","campaigns:read","campaigns:write","campaigns:launch","leads:read","leads:write","deals:read","deals:write","companies:read","companies:write","crm:admin","followups:read","followups:write","followups:enroll"]},"example":["instances:read","instances:write","messages:send"]},"expiresAt":{"description":"Optional expiry. Omit for no expiry.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["name","scopes"]},"CreateAssignmentRuleRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"condition":{"$ref":"#/components/schemas/LeadRule"},"strategy":{"$ref":"#/components/schemas/AssignmentStrategy"},"targetUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"targetTeamId":{"anyOf":[{"type":"string"},{"type":"null"}]},"active":{"default":true,"type":"boolean"}},"required":["name","condition","strategy"]},"CreateCampaignRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"segmentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"audience":{"description":"Inline rule, used when no segment is set.","anyOf":[{"$ref":"#/components/schemas/SegmentRule"},{"type":"null"}]},"message":{"$ref":"#/components/schemas/CampaignMessage"},"instanceIds":{"maxItems":25,"type":"array","items":{"type":"string"}},"instanceStrategy":{"$ref":"#/components/schemas/CampaignInstanceStrategy"},"sendDelayMs":{"anyOf":[{"type":"integer","minimum":0,"maximum":600000},{"type":"null"}]},"messageTtlSeconds":{"anyOf":[{"type":"integer","minimum":300,"maximum":604800},{"type":"null"}]},"skipIfMissingVariables":{"type":"boolean"},"timezone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"followUpSequenceId":{"description":"Enroll every recipient in this active `no_reply` sequence when their campaign message is queued; a reply stops it.","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["name"]},"CreateCompanyRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"domain":{"type":"string","maxLength":253,"pattern":"^(?=.{1,253}$)([a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$"},"industry":{"type":"string","maxLength":100},"size":{"type":"string","enum":["1-10","11-50","51-200","201-500","501-1000","1001-5000","5000+"]},"website":{"type":"string","maxLength":2048,"format":"uri"},"phone":{"type":"string","maxLength":40},"address":{"$ref":"#/components/schemas/Address"},"ownerUserId":{"type":"string"},"customFields":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":2000},{"type":"number"},{"type":"boolean"},{"type":"null"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]},"description":"Values keyed by custom field key. Validated against the project field definitions."},"externalId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"}},"required":["name"]},"CreateConnectSessionRequest":{"type":"object","properties":{"returnUrl":{"description":"Where the hosted page links back to after a successful connection.","type":"string","format":"uri"},"ttlSeconds":{"default":600,"type":"integer","minimum":60,"maximum":1800}}},"CreateCrmFieldRequest":{"type":"object","properties":{"entity":{"$ref":"#/components/schemas/CrmSubjectType"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"label":{"type":"string","minLength":1,"maxLength":80},"type":{"$ref":"#/components/schemas/CrmFieldType"},"options":{"default":[],"maxItems":100,"type":"array","items":{"type":"object","properties":{"value":{"type":"string","minLength":1,"maxLength":100},"label":{"type":"string","minLength":1,"maxLength":100}},"required":["value","label"]}},"required":{"default":false,"type":"boolean"},"aiExtractable":{"default":false,"type":"boolean"},"aiHint":{"type":"string","maxLength":300}},"required":["entity","key","label","type"]},"CreateCrmNoteRequest":{"type":"object","properties":{"subjectType":{"$ref":"#/components/schemas/CrmSubjectType"},"subjectId":{"type":"string"},"body":{"type":"string","minLength":1,"maxLength":10000},"mentions":{"default":[],"maxItems":20,"type":"array","items":{"type":"string"}}},"required":["subjectType","subjectId","body"]},"CreateCrmTaskRequest":{"type":"object","properties":{"subjectType":{"$ref":"#/components/schemas/CrmSubjectType"},"subjectId":{"type":"string"},"type":{"default":"todo","$ref":"#/components/schemas/CrmTaskType"},"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":4000},"dueAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"assigneeUserId":{"description":"Defaults to the subject owner, else the creating user.","type":"string"}},"required":["title"]},"CreateDealRequest":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"pipelineId":{"description":"Defaults to the default pipeline.","type":"string"},"stageId":{"description":"Defaults to the first stage.","type":"string"},"valueMinor":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Amount in the currency’s minor unit (cents for USD).","example":250000},"currency":{"type":"string","pattern":"^[A-Z]{3}$","example":"USD"},"expectedCloseDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"contactId":{"type":"string"},"companyId":{"type":"string"},"leadId":{"type":"string"},"ownerUserId":{"type":"string"},"customFields":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":2000},{"type":"number"},{"type":"boolean"},{"type":"null"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]},"description":"Values keyed by custom field key. Validated against the project field definitions."}},"required":["title"]},"CreateFollowUpEnrollmentRequest":{"type":"object","properties":{"sequenceId":{"type":"string"},"inline":{"description":"A one-off follow-up instead of a saved sequence.","$ref":"#/components/schemas/InlineFollowUp"},"contactId":{"type":"string"},"contact":{"description":"Find or create the contact by phone number.","type":"object","properties":{"phone":{"type":"string","minLength":5,"maxLength":32,"description":"Recipient phone number in international format, with or without \"+\" (for example 923001234567 or +923001234567). Group chats are not supported.","example":"923001234567"},"displayName":{"type":"string","maxLength":120},"externalId":{"type":"string","minLength":1,"maxLength":200},"attributes":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"required":["phone"]},"conversationId":{"description":"Follow up in this conversation (sets the contact and the number).","type":"string"},"instanceId":{"description":"Number to send from (overrides the sequence setting).","type":"string"},"anchorAt":{"description":"The date reminder steps are relative to (required by `anchor_date` steps).","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"timezone":{"description":"Time zone of the contact (send window and {{anchor.*}} formatting).","type":"string","maxLength":64},"variables":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z0-9_]{1,64}$"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}]},"description":"Values for {{vars.<key>}} in messages, e.g. { \"invoiceNo\": \"INV-551\", \"amount\": \"PKR 12,000\" }."},"externalReference":{"description":"Your identifier (e.g. an invoice or booking id); filterable.","type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"},"dedupeKey":{"description":"Enrolling again with the same key returns the existing enrollment instead of creating one.","type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"}}},"CreateFollowUpEnrollmentResponse":{"type":"object","properties":{"enrollment":{"$ref":"#/components/schemas/FollowUpEnrollment"},"created":{"type":"boolean","description":"False when an existing enrollment was returned (dedupe key)."}},"required":["enrollment","created"],"additionalProperties":false},"CreateFollowUpRuleRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"sequenceId":{"type":"string"},"trigger":{"$ref":"#/components/schemas/FollowUpTrigger"},"conditions":{"anyOf":[{"$ref":"#/components/schemas/SegmentRule"},{"type":"null"}]},"anchor":{"$ref":"#/components/schemas/FollowUpRuleAnchor"},"enabled":{"type":"boolean"}},"required":["name","sequenceId","trigger"]},"CreateFollowUpSequenceRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","maxLength":500},"kind":{"$ref":"#/components/schemas/FollowUpKind"},"definition":{"$ref":"#/components/schemas/FollowUpDefinition"}},"required":["name","kind"]},"CreateInstanceRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120,"example":"School A WhatsApp"},"externalReference":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9._:@\\-/]+$","description":"Your own identifier for this instance (for example your tenant ID). Unique within the project.","example":"tenant-101"},"metadata":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]},"description":"Up to 20 key/value pairs for your own bookkeeping. Returned as-is."}},"required":["name"]},"CreateLeadFormRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"title":{"type":"string","maxLength":120},"description":{"type":"string","maxLength":1000},"submitLabel":{"default":"Submit","type":"string","minLength":1,"maxLength":40},"fields":{"minItems":1,"maxItems":30,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":100},"target":{"type":"string","enum":["first_name","last_name","full_name","email","phone","title","company","message","custom"]},"customKey":{"description":"Lead custom field filled by this input (target `custom`).","type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"type":{"default":"text","type":"string","enum":["text","textarea","email","tel","number","select","checkbox","date"]},"required":{"default":false,"type":"boolean"},"placeholder":{"type":"string","maxLength":120},"options":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"value":{"type":"string","minLength":1,"maxLength":100},"label":{"type":"string","minLength":1,"maxLength":100}},"required":["value","label"]}}},"required":["name","label","target"]}},"consent":{"default":{"enabled":false,"text":"","required":true},"type":"object","properties":{"enabled":{"type":"boolean"},"text":{"default":"","type":"string","maxLength":1000},"required":{"default":true,"type":"boolean"}},"required":["enabled"]},"successMessage":{"default":"Thanks! We will be in touch shortly.","type":"string","minLength":1,"maxLength":500},"redirectUrl":{"type":"string","maxLength":2048,"format":"uri"},"allowedOrigins":{"default":[],"description":"Origins allowed to embed the form; empty allows any.","maxItems":20,"type":"array","items":{"type":"string","pattern":"^https?:\\/\\/[^/\\s]+$"}},"instanceId":{"type":"string"},"ownerUserId":{"type":"string"},"tagIds":{"default":[],"maxItems":20,"type":"array","items":{"type":"string"}}},"required":["name","fields"]},"CreateLeadLinkRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"instanceId":{"type":"string"},"prefillText":{"default":"Hi! I would like to know more.","type":"string","minLength":1,"maxLength":500},"utm":{"default":{},"$ref":"#/components/schemas/Utm"},"ownerUserId":{"type":"string"},"tagIds":{"default":[],"maxItems":20,"type":"array","items":{"type":"string"}}},"required":["name","instanceId"]},"CreateLeadRequest":{"type":"object","properties":{"firstName":{"type":"string","maxLength":100},"lastName":{"type":"string","maxLength":100},"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"title":{"type":"string","maxLength":150},"phone":{"description":"The person’s WhatsApp number. Either phone or contactId is required.","type":"string","minLength":5,"maxLength":32,"example":"923001234567"},"contactId":{"type":"string"},"displayName":{"description":"Contact display name, when a contact is created.","type":"string","maxLength":120},"companyId":{"type":"string"},"company":{"description":"Find (by domain, else exact name) or create a company for this lead.","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"domain":{"type":"string","maxLength":253,"pattern":"^(?=.{1,253}$)([a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$"}},"required":["name"]},"source":{"default":"api","type":"string","enum":["api","import","manual"]},"sourceDetail":{"type":"object","properties":{"instanceId":{"type":"string"},"campaignId":{"type":"string"},"utm":{"$ref":"#/components/schemas/Utm"},"referrer":{"type":"string","maxLength":2048},"landingUrl":{"type":"string","maxLength":2048},"label":{"description":"Free-form source label, e.g. \"Trade show 2026\".","type":"string","maxLength":200}}},"ownerUserId":{"type":"string"},"customFields":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":2000},{"type":"number"},{"type":"boolean"},{"type":"null"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]},"description":"Values keyed by custom field key. Validated against the project field definitions."},"tagIds":{"description":"Added to the contact.","maxItems":20,"type":"array","items":{"type":"string"}},"consent":{"$ref":"#/components/schemas/ConsentInput"},"externalId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"},"note":{"description":"Added as the first note.","type":"string","maxLength":4000}}},"CreateLeadResponse":{"type":"object","properties":{"lead":{"$ref":"#/components/schemas/Lead"},"created":{"type":"boolean","description":"False when the contact already had an open lead, which was updated instead."},"consentIgnored":{"type":"boolean"}},"required":["lead","created","consentIgnored"],"additionalProperties":false},"CreateNoteRequest":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":4000}},"required":["body"]},"CreatePipelineRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"stages":{"minItems":3,"maxItems":20,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"probability":{"type":"integer","minimum":0,"maximum":100},"kind":{"default":"open","$ref":"#/components/schemas/StageKind"},"rottenAfterDays":{"anyOf":[{"type":"integer","minimum":1,"maximum":3650},{"type":"null"}]}},"required":["name"]}},"isDefault":{"default":false,"type":"boolean"}},"required":["name"]},"CreateScoringRuleRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"condition":{"$ref":"#/components/schemas/LeadRule"},"points":{"type":"integer","minimum":-1000,"maximum":1000},"active":{"default":true,"type":"boolean"}},"required":["name","condition","points"]},"CreateSegmentRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","maxLength":500},"rule":{"$ref":"#/components/schemas/SegmentRule"}},"required":["name","rule"]},"CreateTagRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":40},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"required":["name"]},"CreateWebhookRequest":{"type":"object","properties":{"url":{"type":"string","maxLength":2048,"format":"uri","description":"HTTPS endpoint (HTTP is only accepted in development deployments). Private network addresses are rejected.","example":"https://api.example.com/whatstig/webhooks"},"events":{"minItems":1,"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/WebhookEventType"},{"type":"string","const":"*"}]},"description":"Event types to deliver, or [\"*\"] for all."},"description":{"type":"string","maxLength":200}},"required":["url","events"]},"CrmActivity":{"type":"object","properties":{"id":{"type":"string"},"subjectType":{"$ref":"#/components/schemas/CrmSubjectType"},"subjectId":{"type":"string"},"type":{"$ref":"#/components/schemas/CrmActivityType"},"actor":{"$ref":"#/components/schemas/CrmActor"},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["id","subjectType","subjectId","type","actor","data","createdAt"],"additionalProperties":false},"CrmActivityType":{"type":"string","enum":["created","captured","status_changed","qualification_changed","owner_changed","stage_changed","fields_changed","score_changed","note_added","task_created","task_completed","ai_extracted","form_submitted","link_clicked","converted","merged","won","lost","reopened","sla_breached","responded"]},"CrmActor":{"type":"object","properties":{"type":{"type":"string","enum":["user","api_key","system","contact","ai"]},"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["type","id","label"],"additionalProperties":false},"CrmFieldDefinition":{"type":"object","properties":{"id":{"type":"string","example":"fld_01jq8x7y2z3a4b5c6d7e8f9g0h"},"entity":{"$ref":"#/components/schemas/CrmSubjectType"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"label":{"type":"string"},"type":{"$ref":"#/components/schemas/CrmFieldType"},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string","minLength":1,"maxLength":100},"label":{"type":"string","minLength":1,"maxLength":100}},"required":["value","label"],"additionalProperties":false}},"required":{"type":"boolean"},"aiExtractable":{"type":"boolean","description":"The AI may fill this field from conversations."},"aiHint":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Tells the AI what this field means, e.g. \"Monthly budget in USD\"."},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archived":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["id","entity","key","label","type","options","required","aiExtractable","aiHint","position","archived","createdAt"],"additionalProperties":false},"CrmFieldDefinitionList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CrmFieldDefinition"}}},"required":["data"],"additionalProperties":false},"CrmFieldType":{"type":"string","enum":["text","long_text","number","currency","boolean","date","select","multi_select","email","url","phone"]},"CrmNote":{"type":"object","properties":{"id":{"type":"string"},"subjectType":{"$ref":"#/components/schemas/CrmSubjectType"},"subjectId":{"type":"string"},"body":{"type":"string"},"mentions":{"type":"array","items":{"type":"string"}},"author":{"anyOf":[{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"}},"required":["userId","name"],"additionalProperties":false},{"type":"null"}]},"authorType":{"type":"string","enum":["user","api_key"]},"editedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["id","subjectType","subjectId","body","mentions","author","authorType","editedAt","createdAt"],"additionalProperties":false},"CrmReport":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"funnel":{"type":"object","properties":{"leads":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mql":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sql":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"converted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"won":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["leads","mql","sql","converted","won"],"additionalProperties":false},"bySource":{"type":"array","items":{"type":"object","properties":{"source":{"$ref":"#/components/schemas/LeadSource"},"leads":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"converted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"won":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["source","leads","converted","won"],"additionalProperties":false}},"leadsByDay":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"leads":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["date","leads"],"additionalProperties":false}},"speedToLead":{"type":"object","properties":{"medianMinutes":{"anyOf":[{"type":"number"},{"type":"null"}]},"responded":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"slaBreached":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"slaCompliance":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Share of leads with an SLA that were answered in time (0-1)."}},"required":["medianMinutes","responded","slaBreached","slaCompliance"],"additionalProperties":false},"pipeline":{"type":"array","items":{"type":"object","properties":{"stageId":{"type":"string"},"stageName":{"type":"string"},"kind":{"$ref":"#/components/schemas/StageKind"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totals":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"valueMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"weightedMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["currency","valueMinor","weightedMinor"],"additionalProperties":false}},"avgDaysInStage":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["stageId","stageName","kind","count","totals","avgDaysInStage"],"additionalProperties":false}},"winRate":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Won / (won + lost) for deals closed in the period."},"forecast":{"type":"array","items":{"type":"object","properties":{"month":{"type":"string"},"currency":{"type":"string"},"weightedMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"valueMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["month","currency","weightedMinor","valueMinor"],"additionalProperties":false}},"owners":{"type":"array","items":{"type":"object","properties":{"owner":{"anyOf":[{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"}},"required":["userId","name"],"additionalProperties":false},{"type":"null"}]},"leads":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"converted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"won":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"wonValue":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"valueMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["currency","valueMinor"],"additionalProperties":false}}},"required":["owner","leads","converted","won","wonValue"],"additionalProperties":false}}},"required":["from","to","funnel","bySource","leadsByDay","speedToLead","pipeline","winRate","forecast","owners"],"additionalProperties":false},"CrmSettings":{"type":"object","properties":{"capture":{"type":"object","default":{"mode":"off","keywords":[],"instanceIds":[],"reopenAfterDays":30},"properties":{"mode":{"default":"off","description":"How inbound WhatsApp messages create leads. `all_new`: every contact without an open lead. `keywords`: messages containing one of the keywords. `ai`: the AI decides whether the conversation is a sales enquiry.","$ref":"#/components/schemas/LeadCaptureMode"},"keywords":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":60}},"instanceIds":{"default":[],"description":"Only these instances; empty means all.","maxItems":200,"type":"array","items":{"type":"string"}},"reopenAfterDays":{"default":30,"description":"Do not capture a contact again within this many days of their last lead being closed.","type":"integer","minimum":0,"maximum":3650}},"required":["mode","keywords","instanceIds","reopenAfterDays"],"additionalProperties":false},"ai":{"type":"object","default":{"extraction":false,"classifyMinConfidence":0.7,"fieldMinConfidence":0.6,"reextractAfterMinutes":10,"qualifyingQuestions":false,"maxQualificationQuestions":3,"handoffOnQualified":false},"properties":{"extraction":{"default":false,"description":"Let the AI fill lead fields from conversations.","type":"boolean"},"classifyMinConfidence":{"default":0.7,"type":"number","minimum":0,"maximum":1},"fieldMinConfidence":{"default":0.6,"type":"number","minimum":0,"maximum":1},"reextractAfterMinutes":{"default":10,"type":"integer","minimum":1,"maximum":1440},"qualifyingQuestions":{"default":false,"description":"When AI auto-reply is on, let it ask for missing qualification details.","type":"boolean"},"maxQualificationQuestions":{"default":3,"type":"integer","minimum":1,"maximum":10},"handoffOnQualified":{"default":false,"description":"Hand the conversation to the lead owner once the lead is sales-qualified.","type":"boolean"}},"required":["extraction","classifyMinConfidence","fieldMinConfidence","reextractAfterMinutes","qualifyingQuestions","maxQualificationQuestions","handoffOnQualified"],"additionalProperties":false},"qualification":{"type":"object","default":{"mqlScore":30,"sqlScore":60,"requiredForSql":[],"autoQualify":true},"properties":{"mqlScore":{"default":30,"type":"integer","minimum":-10000,"maximum":10000},"sqlScore":{"default":60,"type":"integer","minimum":-10000,"maximum":10000},"requiredForSql":{"default":[],"description":"Standard fields (email, title, company, first_name, last_name) or custom field keys a lead needs to be sales-qualified.","maxItems":20,"type":"array","items":{"type":"string","maxLength":64}},"autoQualify":{"default":true,"description":"Move open leads to `qualified` when they become sales-qualified.","type":"boolean"}},"required":["mqlScore","sqlScore","requiredForSql","autoQualify"],"additionalProperties":false},"sla":{"type":"object","default":{"enabled":false,"firstResponseMinutes":15,"businessHoursOnly":true},"properties":{"enabled":{"default":false,"type":"boolean"},"firstResponseMinutes":{"default":15,"type":"integer","minimum":1,"maximum":10080},"businessHoursOnly":{"default":true,"description":"Count only the inbox business hours.","type":"boolean"}},"required":["enabled","firstResponseMinutes","businessHoursOnly"],"additionalProperties":false},"assignment":{"type":"object","default":{"enabled":false,"fallback":"none","inheritConversationAssignee":true,"maxOpenLeadsPerUser":null},"properties":{"enabled":{"default":false,"type":"boolean"},"fallback":{"default":"none","type":"string","enum":["none","round_robin","least_busy"]},"inheritConversationAssignee":{"default":true,"type":"boolean"},"maxOpenLeadsPerUser":{"default":null,"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"null"}]}},"required":["enabled","fallback","inheritConversationAssignee","maxOpenLeadsPerUser"],"additionalProperties":false},"visibility":{"type":"string","default":"all","description":"`own_team`: agents see only leads and deals owned by them or their teams.","enum":["all","own_team"]},"defaultCurrency":{"type":"string","default":"USD","pattern":"^[A-Z]{3}$","example":"USD"},"defaultPipelineId":{"default":null,"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]}},"required":["capture","ai","qualification","sla","assignment","visibility","defaultCurrency","defaultPipelineId","updatedAt"],"additionalProperties":false},"CrmSubjectType":{"type":"string","enum":["lead","deal","company"]},"CrmTask":{"type":"object","properties":{"id":{"type":"string","example":"tsk_01jq8x7y2z3a4b5c6d7e8f9g0h"},"subjectType":{"anyOf":[{"$ref":"#/components/schemas/CrmSubjectType"},{"type":"null"}]},"subjectId":{"anyOf":[{"type":"string"},{"type":"null"}]},"subjectName":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"$ref":"#/components/schemas/CrmTaskType"},"title":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"dueAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"assignee":{"anyOf":[{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"}},"required":["userId","name"],"additionalProperties":false},{"type":"null"}]},"status":{"$ref":"#/components/schemas/CrmTaskStatus"},"overdue":{"type":"boolean"},"completedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["id","subjectType","subjectId","subjectName","type","title","description","dueAt","assignee","status","overdue","completedAt","createdAt","updatedAt"],"additionalProperties":false},"CrmTaskList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CrmTask"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"],"additionalProperties":false},"CrmTaskStatus":{"type":"string","enum":["open","done","cancelled"]},"CrmTaskType":{"type":"string","enum":["call","whatsapp","email","meeting","todo"]},"CrmTimeline":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CrmTimelineItem"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"],"additionalProperties":false},"CrmTimelineItem":{"type":"object","properties":{"kind":{"type":"string","enum":["activity","note"]},"id":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"activity":{"anyOf":[{"$ref":"#/components/schemas/CrmActivity"},{"type":"null"}]},"note":{"anyOf":[{"$ref":"#/components/schemas/CrmNote"},{"type":"null"}]}},"required":["kind","id","createdAt","activity","note"],"additionalProperties":false},"Deal":{"type":"object","properties":{"id":{"type":"string","example":"deal_01jq8x7y2z3a4b5c6d7e8f9g0h"},"projectId":{"type":"string"},"pipelineId":{"type":"string"},"stageId":{"type":"string"},"title":{"type":"string"},"status":{"$ref":"#/components/schemas/DealStatus"},"valueMinor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"currency":{"type":"string"},"probability":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Stage probability (0-100)."},"expectedCloseDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"leadId":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactId":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyId":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"owner":{"anyOf":[{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"}},"required":["userId","name"],"additionalProperties":false},{"type":"null"}]},"lostReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"rank":{"type":"string","description":"Sort key within the stage (board order)."},"stageEnteredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"rotten":{"type":"boolean","description":"Idle in the stage longer than the stage allows."},"wonAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"lostAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"lastActivityAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["id","projectId","pipelineId","stageId","title","status","valueMinor","currency","probability","expectedCloseDate","leadId","contactId","contactName","companyId","companyName","owner","lostReason","customFields","rank","stageEnteredAt","rotten","wonAt","lostAt","lastActivityAt","version","createdAt","updatedAt"],"additionalProperties":false},"DealBoard":{"type":"object","properties":{"pipeline":{"$ref":"#/components/schemas/Pipeline"},"columns":{"type":"array","items":{"type":"object","properties":{"stageId":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totals":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"valueMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"weightedMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["currency","valueMinor","weightedMinor"],"additionalProperties":false}},"deals":{"type":"array","items":{"$ref":"#/components/schemas/Deal"}},"hasMore":{"type":"boolean"}},"required":["stageId","count","totals","deals","hasMore"],"additionalProperties":false}}},"required":["pipeline","columns"],"additionalProperties":false},"DealList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Deal"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"],"additionalProperties":false},"DealStatus":{"type":"string","enum":["open","won","lost"]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["VALIDATION_ERROR","IDEMPOTENCY_KEY_REQUIRED","INVALID_RECIPIENT","WEBHOOK_URL_REJECTED","SEGMENT_TOO_COMPLEX","RULE_TOO_COMPLEX","INVALID_FIELD_VALUE","CAPTCHA_FAILED","UNAUTHENTICATED","INSUFFICIENT_SCOPE","FORBIDDEN","CSRF_REJECTED","INSTANCE_LIMIT_REACHED","QUOTA_EXCEEDED","FEATURE_NOT_AVAILABLE","SEAT_LIMIT_REACHED","CONTACT_LIMIT_REACHED","CAMPAIGN_LIMIT_REACHED","LEAD_LIMIT_REACHED","PIPELINE_LIMIT_REACHED","FORM_LIMIT_REACHED","FOLLOWUP_LIMIT_REACHED","ORIGIN_NOT_ALLOWED","NOT_FOUND","PARTNER_ORG_NOT_LINKED","CONFLICT","EXTERNAL_REFERENCE_TAKEN","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_REQUEST_IN_PROGRESS","INSTANCE_STATE_CONFLICT","QR_NOT_AVAILABLE","MEDIA_NOT_READY","REPLY_COLLISION","CAMPAIGN_STATE_CONFLICT","CONTACT_OPTED_OUT","INVALID_TRANSITION","STAGE_NOT_IN_PIPELINE","FORM_NOT_ACCEPTING","FOLLOWUP_SEQUENCE_NOT_ACTIVE","FOLLOWUP_ALREADY_ENROLLED","PAYLOAD_TOO_LARGE","UNSUPPORTED_MEDIA_TYPE","RATE_LIMITED","BACKLOG_LIMIT_REACHED","INTERNAL_ERROR","SERVICE_UNAVAILABLE"]},"message":{"type":"string"},"details":{},"requestId":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"EventList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEvent"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"],"additionalProperties":false},"FollowUpAction":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"send_message"},"message":{"$ref":"#/components/schemas/CampaignMessage"},"ai":{"$ref":"#/components/schemas/FollowUpAiOptions"}},"required":["type","message"]},{"type":"object","properties":{"type":{"type":"string","const":"notify"},"to":{"type":"string","enum":["assignee","lead_owner","user"],"description":"The conversation assignee, the lead owner, or a specific member."},"userId":{"type":"string"},"text":{"type":"string","minLength":1,"maxLength":500}},"required":["type","to","text"]},{"type":"object","properties":{"type":{"type":"string","const":"tag"},"add":{"default":[],"maxItems":20,"type":"array","items":{"type":"string"}},"remove":{"default":[],"maxItems":20,"type":"array","items":{"type":"string"}}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"resolve_conversation"}},"required":["type"]}]},"FollowUpAction_Output":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"send_message"},"message":{"$ref":"#/components/schemas/CampaignMessage_Output"},"ai":{"$ref":"#/components/schemas/FollowUpAiOptions_Output"}},"required":["type","message"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"notify"},"to":{"type":"string","enum":["assignee","lead_owner","user"],"description":"The conversation assignee, the lead owner, or a specific member."},"userId":{"type":"string"},"text":{"type":"string","minLength":1,"maxLength":500}},"required":["type","to","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"tag"},"add":{"default":[],"maxItems":20,"type":"array","items":{"type":"string"}},"remove":{"default":[],"maxItems":20,"type":"array","items":{"type":"string"}}},"required":["type","add","remove"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"resolve_conversation"}},"required":["type"],"additionalProperties":false}]},"FollowUpAiOptions":{"type":"object","properties":{"enabled":{"default":false,"type":"boolean"},"instructions":{"default":"","description":"What the follow-up should achieve, e.g. \"Ask politely whether they had a chance to look at the quote.\"","type":"string","maxLength":1000},"maxChars":{"default":400,"type":"integer","minimum":80,"maximum":1000},"onFailure":{"default":"template","description":"When the AI cannot write a confident message (budget, provider, low confidence): send the template, or skip the step.","type":"string","enum":["template","skip"]}}},"FollowUpAiOptions_Output":{"type":"object","properties":{"enabled":{"default":false,"type":"boolean"},"instructions":{"default":"","description":"What the follow-up should achieve, e.g. \"Ask politely whether they had a chance to look at the quote.\"","type":"string","maxLength":1000},"maxChars":{"default":400,"type":"integer","minimum":80,"maximum":1000},"onFailure":{"default":"template","description":"When the AI cannot write a confident message (budget, provider, low confidence): send the template, or skip the step.","type":"string","enum":["template","skip"]}},"required":["enabled","instructions","maxChars","onFailure"],"additionalProperties":false},"FollowUpBulkJob":{"type":"object","properties":{"id":{"type":"string"},"sequenceId":{"type":"string"},"status":{"type":"string","enum":["queued","processing","completed","failed","cancelled"]},"total":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"processed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enrolled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"completedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]}},"required":["id","sequenceId","status","total","processed","enrolled","skipped","error","createdAt","completedAt"],"additionalProperties":false},"FollowUpDefinition":{"type":"object","properties":{"steps":{"default":[],"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/FollowUpStep"}},"settings":{"default":{"stopOn":{"reply":true,"humanMessage":true,"conversationResolved":false,"leadClosed":true},"sendWindow":"project","consentMode":null,"instance":"conversation","instanceId":null,"pastDueGraceSeconds":3600,"messageTtlSeconds":null,"reentry":"after_finish"},"$ref":"#/components/schemas/FollowUpSequenceSettings"}}},"FollowUpDefinition_Output":{"type":"object","properties":{"steps":{"default":[],"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/FollowUpStep_Output"}},"settings":{"default":{"stopOn":{"reply":true,"humanMessage":true,"conversationResolved":false,"leadClosed":true},"sendWindow":"project","consentMode":null,"instance":"conversation","instanceId":null,"pastDueGraceSeconds":3600,"messageTtlSeconds":null,"reentry":"after_finish"},"$ref":"#/components/schemas/FollowUpSequenceSettings_Output"}},"required":["steps","settings"],"additionalProperties":false},"FollowUpEnrollment":{"type":"object","properties":{"id":{"type":"string","example":"fue_01jq8x7y2z3a4b5c6d7e8f9g0h"},"projectId":{"type":"string"},"sequenceId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Null for a one-off follow-up created from a conversation."},"sequenceName":{"anyOf":[{"type":"string"},{"type":"null"}]},"versionNumber":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"kind":{"$ref":"#/components/schemas/FollowUpKind"},"contact":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","phone"],"additionalProperties":false},"instanceId":{"anyOf":[{"type":"string"},{"type":"null"}]},"conversationId":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"$ref":"#/components/schemas/FollowUpEnrollmentStatus"},"pauseReason":{"anyOf":[{"type":"string","enum":["user","sequence_paused","instance_unavailable","quota_exceeded"]},{"type":"null"}]},"stepIndex":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Index of the next step to run (equals totalSteps when finished)."},"totalSteps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"nextRunAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"anchorAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"variables":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"source":{"$ref":"#/components/schemas/FollowUpEnrollmentSource"},"sourceRef":{"anyOf":[{"type":"string"},{"type":"null"}]},"externalReference":{"anyOf":[{"type":"string"},{"type":"null"}]},"stopReason":{"anyOf":[{"$ref":"#/components/schemas/FollowUpStopReason"},{"type":"null"}]},"stoppedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"repliedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"lastMessageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"runs":{"description":"Step history (detail endpoint only).","type":"array","items":{"$ref":"#/components/schemas/FollowUpStepRun"}},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["id","projectId","sequenceId","sequenceName","versionNumber","kind","contact","instanceId","conversationId","status","pauseReason","stepIndex","totalSteps","nextRunAt","anchorAt","timezone","variables","source","sourceRef","externalReference","stopReason","stoppedAt","repliedAt","completedAt","lastMessageId","version","createdAt","updatedAt"],"additionalProperties":false},"FollowUpEnrollmentArray":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/FollowUpEnrollment"}}},"required":["data"],"additionalProperties":false},"FollowUpEnrollmentList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/FollowUpEnrollment"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"],"additionalProperties":false},"FollowUpEnrollmentSource":{"type":"string","enum":["api","rule","manual","inbox","campaign","bulk"]},"FollowUpEnrollmentStatus":{"type":"string","enum":["active","paused","completed","stopped","failed"]},"FollowUpKind":{"type":"string","enum":["no_reply","reminder"],"description":"`no_reply`: nudge contacts who have not answered (stops on reply). `reminder`: messages relative to a date (appointment, invoice due)."},"FollowUpPreviewRequest":{"type":"object","properties":{"message":{"$ref":"#/components/schemas/CampaignMessage"},"contactId":{"type":"string"},"variables":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}]}},"anchorAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"timezone":{"type":"string","maxLength":64}},"required":["message"]},"FollowUpRule":{"type":"object","properties":{"id":{"type":"string","example":"fur_01jq8x7y2z3a4b5c6d7e8f9g0h"},"projectId":{"type":"string"},"name":{"type":"string"},"sequenceId":{"type":"string"},"trigger":{"$ref":"#/components/schemas/FollowUpTrigger_Output"},"conditions":{"anyOf":[{"$ref":"#/components/schemas/SegmentRule_Output"},{"type":"null"}],"description":"Contact conditions (same rules as segments)."},"anchor":{"$ref":"#/components/schemas/FollowUpRuleAnchor_Output"},"enabled":{"type":"boolean"},"enrolledCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastTriggeredAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["id","projectId","name","sequenceId","trigger","conditions","anchor","enabled","enrolledCount","lastTriggeredAt","version","createdAt","updatedAt"],"additionalProperties":false},"FollowUpRuleAnchor":{"oneOf":[{"type":"object","properties":{"source":{"type":"string","const":"none"}},"required":["source"]},{"type":"object","properties":{"source":{"type":"string","const":"trigger_time"}},"required":["source"]},{"type":"object","properties":{"source":{"type":"string","const":"contact_attribute"},"key":{"type":"string","pattern":"^[A-Za-z0-9_.-]{1,64}$"}},"required":["source","key"]}],"description":"Where a reminder’s anchor date comes from."},"FollowUpRuleAnchor_Output":{"oneOf":[{"type":"object","properties":{"source":{"type":"string","const":"none"}},"required":["source"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","const":"trigger_time"}},"required":["source"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","const":"contact_attribute"},"key":{"type":"string","pattern":"^[A-Za-z0-9_.-]{1,64}$"}},"required":["source","key"],"additionalProperties":false}],"description":"Where a reminder’s anchor date comes from."},"FollowUpRuleList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/FollowUpRule"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"],"additionalProperties":false},"FollowUpSequence":{"type":"object","properties":{"id":{"type":"string","example":"fus_01jq8x7y2z3a4b5c6d7e8f9g0h"},"projectId":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"kind":{"$ref":"#/components/schemas/FollowUpKind"},"status":{"$ref":"#/components/schemas/FollowUpSequenceStatus"},"definition":{"description":"The editable (draft) definition.","$ref":"#/components/schemas/FollowUpDefinition_Output"},"published":{"anyOf":[{"type":"object","properties":{"versionId":{"type":"string"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"publishedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"definition":{"$ref":"#/components/schemas/FollowUpDefinition_Output"}},"required":["versionId","number","publishedAt","definition"],"additionalProperties":false},{"type":"null"}],"description":"The version new enrollments use. Enrollments keep the version they started with."},"hasUnpublishedChanges":{"type":"boolean"},"counts":{"type":"object","properties":{"active":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paused":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"completed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stopped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["active","paused","completed","stopped","failed"],"additionalProperties":false},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["id","projectId","name","description","kind","status","definition","published","hasUnpublishedChanges","counts","version","createdAt","updatedAt"],"additionalProperties":false},"FollowUpSequenceList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/FollowUpSequence"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"],"additionalProperties":false},"FollowUpSequenceSettings":{"type":"object","properties":{"stopOn":{"default":{"reply":true,"humanMessage":true,"conversationResolved":false,"leadClosed":true},"$ref":"#/components/schemas/FollowUpStopConditions"},"sendWindow":{"default":"project","description":"`project`: only inside the project’s send window (quiet hours otherwise). `always`: any time (urgent reminders).","type":"string","enum":["project","always"]},"consentMode":{"default":null,"description":"Overrides the project setting (null: use it).","anyOf":[{"$ref":"#/components/schemas/ConsentMode"},{"type":"null"}]},"instance":{"default":"conversation","description":"`conversation`: the number the contact last talked to (else the default). `fixed`: `instanceId`.","type":"string","enum":["conversation","fixed","project_default"]},"instanceId":{"default":null,"anyOf":[{"type":"string"},{"type":"null"}]},"pastDueGraceSeconds":{"default":3600,"description":"A step whose time already passed (late enrollment, quiet hours) still runs within this grace; later it is skipped.","type":"integer","minimum":0,"maximum":86400},"messageTtlSeconds":{"default":null,"anyOf":[{"type":"integer","minimum":300,"maximum":604800},{"type":"null"}]},"reentry":{"default":"after_finish","description":"`never`: a contact goes through the sequence once. `after_finish`: again once the previous enrollment ended. `always`: a new enrollment replaces the active one.","type":"string","enum":["never","after_finish","always"]}}},"FollowUpSequenceSettings_Output":{"type":"object","properties":{"stopOn":{"default":{"reply":true,"humanMessage":true,"conversationResolved":false,"leadClosed":true},"$ref":"#/components/schemas/FollowUpStopConditions_Output"},"sendWindow":{"default":"project","description":"`project`: only inside the project’s send window (quiet hours otherwise). `always`: any time (urgent reminders).","type":"string","enum":["project","always"]},"consentMode":{"default":null,"description":"Overrides the project setting (null: use it).","anyOf":[{"$ref":"#/components/schemas/ConsentMode"},{"type":"null"}]},"instance":{"default":"conversation","description":"`conversation`: the number the contact last talked to (else the default). `fixed`: `instanceId`.","type":"string","enum":["conversation","fixed","project_default"]},"instanceId":{"default":null,"anyOf":[{"type":"string"},{"type":"null"}]},"pastDueGraceSeconds":{"default":3600,"description":"A step whose time already passed (late enrollment, quiet hours) still runs within this grace; later it is skipped.","type":"integer","minimum":0,"maximum":86400},"messageTtlSeconds":{"default":null,"anyOf":[{"type":"integer","minimum":300,"maximum":604800},{"type":"null"}]},"reentry":{"default":"after_finish","description":"`never`: a contact goes through the sequence once. `after_finish`: again once the previous enrollment ended. `always`: a new enrollment replaces the active one.","type":"string","enum":["never","after_finish","always"]}},"required":["stopOn","sendWindow","consentMode","instance","instanceId","pastDueGraceSeconds","messageTtlSeconds","reentry"],"additionalProperties":false},"FollowUpSequenceStatus":{"type":"string","enum":["draft","active","paused","archived"]},"FollowUpSettings":{"type":"object","properties":{"timezone":{"type":"string","default":"UTC","description":"Time zone of the send window (enrollments may override it).","maxLength":64},"sendWindow":{"type":"object","default":{"enabled":true,"days":[{"day":1,"open":"09:00","close":"20:00"},{"day":2,"open":"09:00","close":"20:00"},{"day":3,"open":"09:00","close":"20:00"},{"day":4,"open":"09:00","close":"20:00"},{"day":5,"open":"09:00","close":"20:00"},{"day":6,"open":"09:00","close":"20:00"}],"holidays":[]},"description":"When follow-up messages may be sent. Steps due outside it wait for the next opening.","properties":{"enabled":{"default":false,"type":"boolean"},"days":{"default":[{"day":1,"open":"09:00","close":"17:00"},{"day":2,"open":"09:00","close":"17:00"},{"day":3,"open":"09:00","close":"17:00"},{"day":4,"open":"09:00","close":"17:00"},{"day":5,"open":"09:00","close":"17:00"}],"maxItems":28,"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":0,"maximum":6},"open":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"close":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["day","open","close"],"additionalProperties":false}},"holidays":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}}},"required":["enabled","days","holidays"],"additionalProperties":false},"maxPerContactPerDay":{"type":"integer","default":2,"description":"Follow-up messages a contact receives in any 24 hours, across all sequences. Extra steps wait.","minimum":1,"maximum":20},"sendDelayMs":{"type":"integer","default":5000,"description":"Minimum gap between two follow-up messages on the same number.","minimum":0,"maximum":600000},"consentMode":{"default":"opt_out","description":"`opt_out` (default): everyone except opted-out contacts. `opt_in`: only contacts with a recorded opt-in.","$ref":"#/components/schemas/ConsentMode"},"defaultInstanceId":{"default":null,"anyOf":[{"type":"string"},{"type":"null"}]},"defaultMessageTtlSeconds":{"type":"integer","default":21600,"minimum":300,"maximum":604800},"retentionDays":{"type":"integer","default":90,"description":"Finished enrollments are deleted after this many days.","minimum":7,"maximum":730}},"required":["timezone","sendWindow","maxPerContactPerDay","sendDelayMs","consentMode","defaultInstanceId","defaultMessageTtlSeconds","retentionDays"],"additionalProperties":false},"FollowUpStats":{"type":"object","properties":{"enrolled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"active":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"completed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stopped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"replied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"replyRate":{"type":"number","description":"Replied / enrollments that sent at least one message (0-1)."},"stopReasons":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"steps":{"type":"array","items":{"$ref":"#/components/schemas/FollowUpStepStats"}},"generatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["enrolled","active","completed","stopped","failed","replied","replyRate","stopReasons","steps","generatedAt"],"additionalProperties":false},"FollowUpStep":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$","description":"Stable identifier of the step within the sequence (used in stats)."},"name":{"type":"string","maxLength":80},"wait":{"type":"object","properties":{"anchor":{"$ref":"#/components/schemas/FollowUpStepAnchor"},"offsetSeconds":{"type":"integer","minimum":-31536000,"maximum":31536000,"description":"Delay after the anchor. Negative values (before the date) are only allowed with `anchor_date`."}},"required":["anchor","offsetSeconds"]},"onlyIf":{"type":"object","properties":{"noReply":{"description":"Run only if the contact has not replied since the enrollment started.","type":"boolean"},"notRead":{"description":"Run only if the previous follow-up message was not read.","type":"boolean"}}},"action":{"$ref":"#/components/schemas/FollowUpAction"}},"required":["id","wait","action"]},"FollowUpStep_Output":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$","description":"Stable identifier of the step within the sequence (used in stats)."},"name":{"type":"string","maxLength":80},"wait":{"type":"object","properties":{"anchor":{"$ref":"#/components/schemas/FollowUpStepAnchor"},"offsetSeconds":{"type":"integer","minimum":-31536000,"maximum":31536000,"description":"Delay after the anchor. Negative values (before the date) are only allowed with `anchor_date`."}},"required":["anchor","offsetSeconds"],"additionalProperties":false},"onlyIf":{"type":"object","properties":{"noReply":{"description":"Run only if the contact has not replied since the enrollment started.","type":"boolean"},"notRead":{"description":"Run only if the previous follow-up message was not read.","type":"boolean"}},"additionalProperties":false},"action":{"$ref":"#/components/schemas/FollowUpAction_Output"}},"required":["id","wait","action"],"additionalProperties":false},"FollowUpStepAnchor":{"type":"string","enum":["enrollment","previous_step","anchor_date"]},"FollowUpStepRun":{"type":"object","properties":{"stepIndex":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stepId":{"type":"string"},"action":{"type":"string","enum":["send_message","notify","tag","resolve_conversation"]},"outcome":{"type":"string","enum":["queued","done","skipped","failed"]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"messageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"messageStatus":{"anyOf":[{"type":"string"},{"type":"null"}]},"ai":{"type":"boolean"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["stepIndex","stepId","action","outcome","reason","messageId","messageStatus","ai","occurredAt"],"additionalProperties":false},"FollowUpStepStats":{"type":"object","properties":{"stepId":{"type":"string"},"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"action":{"type":"string","enum":["send_message","notify","tag","resolve_conversation"]},"reached":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Enrollments that got to this step (ran or skipped it)."},"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"delivered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"read":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"replied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Contacts who replied after this step (before the next)."}},"required":["stepId","index","name","action","reached","queued","sent","delivered","read","failed","skipped","replied"],"additionalProperties":false},"FollowUpStopConditions":{"type":"object","properties":{"reply":{"default":true,"description":"Stop when the contact sends a message.","type":"boolean"},"humanMessage":{"default":true,"description":"Stop when a team member messages the contact (inbox or phone).","type":"boolean"},"conversationResolved":{"default":false,"type":"boolean"},"leadClosed":{"default":true,"description":"Stop when the contact’s open lead is won, lost or converted.","type":"boolean"}}},"FollowUpStopConditions_Output":{"type":"object","properties":{"reply":{"default":true,"description":"Stop when the contact sends a message.","type":"boolean"},"humanMessage":{"default":true,"description":"Stop when a team member messages the contact (inbox or phone).","type":"boolean"},"conversationResolved":{"default":false,"type":"boolean"},"leadClosed":{"default":true,"description":"Stop when the contact’s open lead is won, lost or converted.","type":"boolean"}},"required":["reply","humanMessage","conversationResolved","leadClosed"],"additionalProperties":false},"FollowUpStopReason":{"type":"string","enum":["replied","human_replied","opted_out","manual","lead_closed","conversation_resolved","contact_deleted","instance_deleted","sequence_archived","superseded","plan_changed"]},"FollowUpTrigger":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"contact_created"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"tag_added"},"tagId":{"type":"string"}},"required":["type","tagId"]},{"type":"object","properties":{"type":{"type":"string","const":"inbound_keyword"},"keywords":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"match":{"default":"whole","type":"string","enum":["whole","contains"]}},"required":["type","keywords"]},{"type":"object","properties":{"type":{"type":"string","const":"conversation_resolved"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"lead_created"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"lead_status_changed"},"status":{"type":"string","maxLength":40}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"deal_stage_changed"},"pipelineId":{"type":"string"},"stageId":{"type":"string"}},"required":["type"]}]},"FollowUpTrigger_Output":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"contact_created"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"tag_added"},"tagId":{"type":"string"}},"required":["type","tagId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"inbound_keyword"},"keywords":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"match":{"default":"whole","type":"string","enum":["whole","contains"]}},"required":["type","keywords","match"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"conversation_resolved"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"lead_created"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"lead_status_changed"},"status":{"type":"string","maxLength":40}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"deal_stage_changed"},"pipelineId":{"type":"string"},"stageId":{"type":"string"}},"required":["type"],"additionalProperties":false}]},"ImportMediaRequest":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Public HTTPS URL to fetch. Private and internal addresses are rejected."},"fileName":{"type":"string","minLength":1,"maxLength":200}},"required":["url"]},"InboxMessage":{"type":"object","properties":{"id":{"type":"string"},"direction":{"type":"string","enum":["outbound","inbound"]},"type":{"type":"string"},"status":{"$ref":"#/components/schemas/MessageStatus"},"source":{"anyOf":[{"$ref":"#/components/schemas/MessageOrigin"},{"type":"null"}]},"author":{"anyOf":[{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"}},"required":["userId","name"],"additionalProperties":false},{"type":"null"}]},"content":{"anyOf":[{"$ref":"#/components/schemas/MessageContent"},{"type":"null"}]},"contentPurged":{"type":"boolean"},"failure":{"anyOf":[{"type":"object","properties":{"code":{"$ref":"#/components/schemas/MessageFailureCode"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"sentAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"deliveredAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"readAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]}},"required":["id","direction","type","status","source","author","content","contentPurged","failure","createdAt","sentAt","deliveredAt","readAt"],"additionalProperties":false},"InlineFollowUp":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/FollowUpKind"},"steps":{"minItems":1,"maxItems":3,"type":"array","items":{"$ref":"#/components/schemas/FollowUpStep"}},"settings":{"$ref":"#/components/schemas/FollowUpSequenceSettings"}},"required":["kind","steps"]},"Instance":{"type":"object","properties":{"id":{"type":"string","example":"wa_01jq8x7y2z3a4b5c6d7e8f9g0h"},"projectId":{"type":"string"},"name":{"type":"string"},"externalReference":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"$ref":"#/components/schemas/InstanceStatus"},"desiredState":{"type":"string","enum":["CONNECTED","DISCONNECTED"]},"reasonCode":{"anyOf":[{"$ref":"#/components/schemas/InstanceReasonCode"},{"type":"null"}]},"phoneNumber":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"E.164 number of the linked account, once connected."},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"WhatsApp profile name reported by the linked account."},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"lastConnectedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"lastDisconnectedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["id","projectId","name","externalReference","status","desiredState","reasonCode","phoneNumber","displayName","metadata","lastConnectedAt","lastDisconnectedAt","createdAt","updatedAt"],"additionalProperties":false},"InstanceList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Instance"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"],"additionalProperties":false},"InstanceReasonCode":{"type":"string","enum":["NEVER_CONNECTED","QR_TIMEOUT","LOGGED_OUT_FROM_PHONE","CONNECTION_REPLACED","ACCOUNT_RESTRICTED","BAD_SESSION","NETWORK_ERROR","RECONNECT_EXHAUSTED","MANUAL_DISCONNECT","MANUAL_LOGOUT","PROVIDER_ERROR"]},"InstanceStatus":{"type":"string","enum":["DISCONNECTED","CONNECTING","QR_REQUIRED","PAIRING_CODE_REQUIRED","CONNECTED","RECONNECTING","LOGGED_OUT","RESTRICTED","ERROR"]},"InstanceStatusResponse":{"type":"object","properties":{"id":{"type":"string"},"status":{"$ref":"#/components/schemas/InstanceStatus"},"desiredState":{"type":"string","enum":["CONNECTED","DISCONNECTED"]},"reasonCode":{"anyOf":[{"$ref":"#/components/schemas/InstanceReasonCode"},{"type":"null"}]},"phoneNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"pairing":{"anyOf":[{"type":"object","properties":{"method":{"type":"string","enum":["qr","pairing_code"]},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["method","expiresAt"],"additionalProperties":false},{"type":"null"}],"description":"Present while the instance is waiting to be linked."},"lastConnectedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["id","status","desiredState","reasonCode","phoneNumber","pairing","lastConnectedAt","updatedAt"],"additionalProperties":false},"LaunchCampaignRequest":{"type":"object","properties":{"scheduledAt":{"description":"Start later; omit to start now.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}}},"Lead":{"type":"object","properties":{"id":{"type":"string","example":"lead_01jq8x7y2z3a4b5c6d7e8f9g0h"},"projectId":{"type":"string"},"contactId":{"type":"string"},"contact":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","phone"],"additionalProperties":false},"companyId":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string","description":"First and last name, else the contact name."},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"$ref":"#/components/schemas/LeadStatus"},"qualification":{"$ref":"#/components/schemas/QualificationLevel"},"qualificationOverridden":{"type":"boolean","description":"Set by a person; scoring no longer changes it."},"score":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"scoreBreakdown":{"type":"array","items":{"type":"object","properties":{"ruleId":{"type":"string"},"name":{"type":"string"},"points":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["ruleId","name","points"],"additionalProperties":false}},"owner":{"anyOf":[{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"}},"required":["userId","name"],"additionalProperties":false},{"type":"null"}]},"teamId":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"$ref":"#/components/schemas/LeadSource"},"sourceDetail":{"$ref":"#/components/schemas/LeadSourceDetail"},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"fieldSources":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"by":{"type":"string","enum":["human","api","form","import","ai"]},"confidence":{"type":"number","minimum":0,"maximum":1},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["by","at"],"additionalProperties":false}},"ai":{"anyOf":[{"$ref":"#/components/schemas/LeadAiInsights"},{"type":"null"}]},"conversationId":{"anyOf":[{"type":"string"},{"type":"null"}]},"disqualifyReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"convertedDealId":{"anyOf":[{"type":"string"},{"type":"null"}]},"externalId":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastActivityAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"firstResponseDueAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"firstRespondedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"slaBreachedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"convertedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"closedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["id","projectId","contactId","contact","companyId","companyName","name","firstName","lastName","email","title","status","qualification","qualificationOverridden","score","scoreBreakdown","owner","teamId","source","sourceDetail","customFields","fieldSources","ai","conversationId","disqualifyReason","convertedDealId","externalId","lastActivityAt","firstResponseDueAt","firstRespondedAt","slaBreachedAt","convertedAt","closedAt","version","createdAt","updatedAt"],"additionalProperties":false},"LeadAiInsights":{"type":"object","properties":{"summary":{"anyOf":[{"type":"string"},{"type":"null"}]},"intent":{"anyOf":[{"type":"string"},{"type":"null"}]},"urgency":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentiment":{"anyOf":[{"type":"string"},{"type":"null"}]},"missing":{"type":"array","items":{"type":"string"},"description":"Qualification details the AI has not found yet."},"extractedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]}},"required":["summary","intent","urgency","sentiment","missing","extractedAt"],"additionalProperties":false},"LeadCaptureMode":{"type":"string","enum":["off","all_new","keywords","ai"]},"LeadForm":{"type":"object","properties":{"id":{"type":"string","example":"frm_01jq8x7y2z3a4b5c6d7e8f9g0h"},"projectId":{"type":"string"},"publicId":{"type":"string","description":"Used in the hosted form URL and the embed snippet."},"name":{"type":"string"},"status":{"type":"string","enum":["active","paused"]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"submitLabel":{"type":"string"},"fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":100},"target":{"type":"string","enum":["first_name","last_name","full_name","email","phone","title","company","message","custom"]},"customKey":{"description":"Lead custom field filled by this input (target `custom`).","type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"type":{"default":"text","type":"string","enum":["text","textarea","email","tel","number","select","checkbox","date"]},"required":{"default":false,"type":"boolean"},"placeholder":{"type":"string","maxLength":120},"options":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"value":{"type":"string","minLength":1,"maxLength":100},"label":{"type":"string","minLength":1,"maxLength":100}},"required":["value","label"],"additionalProperties":false}}},"required":["name","label","target","type","required"],"additionalProperties":false}},"consent":{"type":"object","properties":{"enabled":{"type":"boolean"},"text":{"type":"string"},"required":{"type":"boolean"}},"required":["enabled","text","required"],"additionalProperties":false},"successMessage":{"type":"string"},"redirectUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"allowedOrigins":{"type":"array","items":{"type":"string"}},"instanceId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Offer \"Continue on WhatsApp\" with this number after submitting."},"ownerUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"tagIds":{"type":"array","items":{"type":"string"}},"hostedUrl":{"type":"string"},"embedSnippet":{"type":"string"},"submissionCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["id","projectId","publicId","name","status","title","description","submitLabel","fields","consent","successMessage","redirectUrl","allowedOrigins","instanceId","ownerUserId","tagIds","hostedUrl","embedSnippet","submissionCount","createdAt","updatedAt"],"additionalProperties":false},"LeadFormList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LeadForm"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"],"additionalProperties":false},"LeadLink":{"type":"object","properties":{"id":{"type":"string","example":"lnk_01jq8x7y2z3a4b5c6d7e8f9g0h"},"projectId":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"instanceId":{"type":"string"},"prefillText":{"type":"string"},"utm":{"$ref":"#/components/schemas/Utm_Output"},"active":{"type":"boolean"},"ownerUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"tagIds":{"type":"array","items":{"type":"string"}},"url":{"type":"string","description":"Share this URL (or its QR code)."},"clicks":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"leads":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["id","projectId","code","name","instanceId","prefillText","utm","active","ownerUserId","tagIds","url","clicks","leads","createdAt","updatedAt"],"additionalProperties":false},"LeadLinkList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LeadLink"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"],"additionalProperties":false},"LeadList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Lead"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"],"additionalProperties":false},"LeadRule":{"type":"object","properties":{"type":{"type":"string","const":"group"},"op":{"type":"string","enum":["and","or"]},"negate":{"type":"boolean"},"rules":{"maxItems":50,"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/LeadRule"},{"type":"object","properties":{"type":{"type":"string","const":"field"},"field":{"type":"string","enum":["first_name","last_name","email","title","company","status","qualification","owner_user_id","email_domain"]},"op":{"type":"string","enum":["eq","neq","contains","not_contains","exists","not_exists","gt","gte","lt","lte","in","not_in"]},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}]},{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}]}}]}},"required":["type","field","op"]},{"type":"object","properties":{"type":{"type":"string","const":"custom_field"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"op":{"type":"string","enum":["eq","neq","contains","not_contains","exists","not_exists","gt","gte","lt","lte","in","not_in"]},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}]},{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}]}}]}},"required":["type","key","op"]},{"type":"object","properties":{"type":{"type":"string","const":"source"},"op":{"type":"string","enum":["is","is_not"]},"values":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/LeadSource"}}},"required":["type","op","values"]},{"type":"object","properties":{"type":{"type":"string","const":"utm"},"param":{"type":"string","enum":["source","medium","campaign","term","content"]},"op":{"type":"string","enum":["eq","neq","contains","not_contains","exists","not_exists","gt","gte","lt","lte","in","not_in"]},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}]},{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}]}}]}},"required":["type","param","op"]},{"type":"object","properties":{"type":{"type":"string","const":"contact_tag"},"op":{"type":"string","enum":["has_any","has_all","has_none"]},"tagIds":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string"}}},"required":["type","op","tagIds"]},{"type":"object","properties":{"type":{"type":"string","const":"engagement"},"metric":{"type":"string","enum":["inbound_messages","outbound_messages","form_submissions","days_since_created","days_since_last_activity"]},"op":{"type":"string","enum":["eq","gt","gte","lt","lte"]},"value":{"type":"integer","minimum":0,"maximum":100000}},"required":["type","metric","op","value"]},{"type":"object","properties":{"type":{"type":"string","const":"ai"},"signal":{"type":"string","enum":["intent","urgency","sentiment"]},"op":{"type":"string","enum":["is","is_not"]},"values":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","maxLength":40}}},"required":["type","signal","op","values"]},{"type":"object","properties":{"type":{"type":"string","const":"form"},"formId":{"type":"string"}},"required":["type","formId"]},{"type":"object","properties":{"type":{"type":"string","const":"instance"},"instanceIds":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string"}}},"required":["type","instanceIds"]},{"type":"object","properties":{"type":{"type":"string","const":"phone"},"op":{"type":"string","const":"starts_with"},"value":{"type":"string","pattern":"^\\d{1,6}$"}},"required":["type","op","value"]}]}}},"required":["type","op","rules"],"description":"Conditions on a lead combined with `and`/`or` (optionally negated). Conditions: field, custom_field, source, utm, contact_tag, engagement, ai, form, instance, phone, or a nested group. An empty `and` group matches every lead."},"LeadRule_Output":{"type":"object","properties":{"type":{"type":"string","const":"group"},"op":{"type":"string","enum":["and","or"]},"negate":{"type":"boolean"},"rules":{"maxItems":50,"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/LeadRule_Output"},{"type":"object","properties":{"type":{"type":"string","const":"field"},"field":{"type":"string","enum":["first_name","last_name","email","title","company","status","qualification","owner_user_id","email_domain"]},"op":{"type":"string","enum":["eq","neq","contains","not_contains","exists","not_exists","gt","gte","lt","lte","in","not_in"]},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}]},{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}]}}]}},"required":["type","field","op"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"custom_field"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"op":{"type":"string","enum":["eq","neq","contains","not_contains","exists","not_exists","gt","gte","lt","lte","in","not_in"]},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}]},{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}]}}]}},"required":["type","key","op"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"source"},"op":{"type":"string","enum":["is","is_not"]},"values":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/LeadSource"}}},"required":["type","op","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"utm"},"param":{"type":"string","enum":["source","medium","campaign","term","content"]},"op":{"type":"string","enum":["eq","neq","contains","not_contains","exists","not_exists","gt","gte","lt","lte","in","not_in"]},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}]},{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}]}}]}},"required":["type","param","op"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"contact_tag"},"op":{"type":"string","enum":["has_any","has_all","has_none"]},"tagIds":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string"}}},"required":["type","op","tagIds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"engagement"},"metric":{"type":"string","enum":["inbound_messages","outbound_messages","form_submissions","days_since_created","days_since_last_activity"]},"op":{"type":"string","enum":["eq","gt","gte","lt","lte"]},"value":{"type":"integer","minimum":0,"maximum":100000}},"required":["type","metric","op","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"ai"},"signal":{"type":"string","enum":["intent","urgency","sentiment"]},"op":{"type":"string","enum":["is","is_not"]},"values":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","maxLength":40}}},"required":["type","signal","op","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"form"},"formId":{"type":"string"}},"required":["type","formId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"instance"},"instanceIds":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string"}}},"required":["type","instanceIds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"phone"},"op":{"type":"string","const":"starts_with"},"value":{"type":"string","pattern":"^\\d{1,6}$"}},"required":["type","op","value"],"additionalProperties":false}]}}},"required":["type","op","rules"],"additionalProperties":false,"description":"Conditions on a lead combined with `and`/`or` (optionally negated). Conditions: field, custom_field, source, utm, contact_tag, engagement, ai, form, instance, phone, or a nested group. An empty `and` group matches every lead."},"LeadSource":{"type":"string","enum":["whatsapp","api","form","click_to_chat","import","manual"]},"LeadSourceDetail":{"type":"object","properties":{"instanceId":{"type":"string"},"formId":{"type":"string"},"linkId":{"type":"string"},"importId":{"type":"string"},"campaignId":{"type":"string"},"utm":{"$ref":"#/components/schemas/Utm_Output"},"referrer":{"type":"string","maxLength":2048},"landingUrl":{"type":"string","maxLength":2048},"label":{"description":"Free-form source label, e.g. \"Trade show 2026\".","type":"string","maxLength":200}},"additionalProperties":false},"LeadStatus":{"type":"string","enum":["new","working","qualified","unqualified","converted","archived"]},"Media":{"type":"object","properties":{"id":{"type":"string","example":"med_01jq8x7y2z3a4b5c6d7e8f9g0h"},"kind":{"type":"string","enum":["image","document"]},"direction":{"type":"string","enum":["outbound","inbound"]},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sha256":{"type":"string"},"fileName":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["id","kind","direction","mimeType","sizeBytes","sha256","fileName","expiresAt","createdAt"],"additionalProperties":false},"MediaDownload":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Pre-signed download URL, valid for a few minutes."},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["url","expiresAt"],"additionalProperties":false},"MergeCompaniesRequest":{"type":"object","properties":{"sourceCompanyId":{"type":"string","description":"Merged into the target and deleted."}},"required":["sourceCompanyId"]},"Message":{"type":"object","properties":{"id":{"type":"string","example":"msg_01jq8x7y2z3a4b5c6d7e8f9g0h"},"projectId":{"type":"string"},"instanceId":{"type":"string"},"direction":{"type":"string","enum":["outbound","inbound"]},"type":{"type":"string","enum":["text","image","document","unsupported"]},"status":{"$ref":"#/components/schemas/MessageStatus"},"recipient":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"E.164 recipient (outbound)."},"sender":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"E.164 sender when known (inbound)."},"content":{"anyOf":[{"$ref":"#/components/schemas/MessageContent"},{"type":"null"}]},"clientReference":{"anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"failure":{"anyOf":[{"type":"object","properties":{"code":{"$ref":"#/components/schemas/MessageFailureCode"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false},{"type":"null"}]},"providerMessageId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"WhatsApp message ID, once known."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"sentAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"deliveredAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"readAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"failedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["id","projectId","instanceId","direction","type","status","recipient","sender","content","clientReference","metadata","failure","providerMessageId","createdAt","sentAt","deliveredAt","readAt","failedAt","expiresAt","updatedAt"],"additionalProperties":false},"MessageContent":{"type":"object","properties":{"text":{"type":"string"},"caption":{"type":"string"},"mediaId":{"type":"string"},"fileName":{"type":"string"},"mimeType":{"type":"string"}},"additionalProperties":false,"description":"Message content. Omitted when content retention is disabled or has expired."},"MessageFailureCode":{"type":"string","enum":["INVALID_RECIPIENT","RECIPIENT_NOT_ON_WHATSAPP","INSTANCE_NOT_CONNECTED","INSTANCE_LOGGED_OUT","INSTANCE_DELETED","MEDIA_UNAVAILABLE","EXPIRED","PROVIDER_REJECTED","OUTCOME_UNKNOWN","CANCELLED"]},"MessageList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Message"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"],"additionalProperties":false},"MessageOrigin":{"type":"string","enum":["api","inbox","phone","automation","campaign","followup"]},"MessageStatus":{"type":"string","enum":["QUEUED","PROCESSING","SENT","DELIVERED","READ","FAILED","UNKNOWN","RECEIVED"]},"MessageStatusEvent":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/MessageStatus"},"certainty":{"type":"string","enum":["confirmed","inferred","unknown"]},"detail":{"anyOf":[{"type":"string"},{"type":"null"}]},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["status","certainty","detail","occurredAt"],"additionalProperties":false},"MessageStatusHistory":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MessageStatusEvent"}}},"required":["data"],"additionalProperties":false},"MoveDealRequest":{"type":"object","properties":{"stageId":{"type":"string"},"afterDealId":{"description":"Place after this deal in the stage; null or absent puts it first.","anyOf":[{"type":"string"},{"type":"null"}]},"lostReason":{"description":"When moving into the lost stage.","type":"string","maxLength":500},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["stageId"]},"Note":{"type":"object","properties":{"id":{"type":"string"},"conversationId":{"type":"string"},"author":{"anyOf":[{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"}},"required":["userId","name"],"additionalProperties":false},{"type":"null"}]},"body":{"type":"string"},"mentions":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"editedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]}},"required":["id","conversationId","author","body","mentions","createdAt","editedAt"],"additionalProperties":false},"OptOutContactRequest":{"type":"object","properties":{"reason":{"type":"string","maxLength":500}}},"Pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["nextCursor","hasMore"],"additionalProperties":false},"PairingResponse":{"type":"object","properties":{"instanceId":{"type":"string"},"method":{"type":"string","enum":["qr","pairing_code"]},"qr":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Raw QR payload. Render it yourself or use `qrDataUrl`."},"qrDataUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"PNG data URL of the QR, ready for an <img> tag."},"pairingCode":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Code to type on the phone when method is `pairing_code`."},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z","description":"The QR rotates roughly every 20-60 seconds. Fetch again after this time."}},"required":["instanceId","method","qr","qrDataUrl","pairingCode","expiresAt"],"additionalProperties":false},"Pipeline":{"type":"object","properties":{"id":{"type":"string","example":"pl_01jq8x7y2z3a4b5c6d7e8f9g0h"},"projectId":{"type":"string"},"name":{"type":"string"},"isDefault":{"type":"boolean"},"archived":{"type":"boolean"},"stages":{"type":"array","items":{"$ref":"#/components/schemas/PipelineStage"}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["id","projectId","name","isDefault","archived","stages","createdAt","updatedAt"],"additionalProperties":false},"PipelineList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Pipeline"}}},"required":["data"],"additionalProperties":false},"PipelineStage":{"type":"object","properties":{"id":{"type":"string","example":"stg_01jq8x7y2z3a4b5c6d7e8f9g0h"},"name":{"type":"string"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"probability":{"type":"integer","minimum":0,"maximum":100,"description":"Win probability used for the weighted forecast."},"kind":{"$ref":"#/components/schemas/StageKind"},"rottenAfterDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Deals idle in this stage longer than this are flagged."}},"required":["id","name","position","probability","kind","rottenAfterDays"],"additionalProperties":false},"Project":{"type":"object","properties":{"id":{"type":"string","example":"prj_01jq8x7y2z3a4b5c6d7e8f9g0h"},"organizationId":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"settings":{"type":"object","properties":{"retainMessageContent":{"type":"boolean"},"storeInboundMedia":{"type":"boolean"},"defaultCountryCode":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["retainMessageContent","storeInboundMedia","defaultCountryCode"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["id","organizationId","name","slug","description","settings","createdAt","updatedAt"],"additionalProperties":false},"QualificationLevel":{"type":"string","enum":["none","mql","sql"]},"RecordConsentRequest":{"type":"object","properties":{"source":{"type":"string","enum":["api","form","dashboard","other"]},"proof":{"$ref":"#/components/schemas/ConsentProof"},"overrideOptOut":{"type":"boolean"},"note":{"description":"Required with overrideOptOut.","type":"string","maxLength":500}}},"RenderCampaignPreview":{"type":"object","properties":{"text":{"anyOf":[{"type":"string"},{"type":"null"}]},"caption":{"anyOf":[{"type":"string"},{"type":"null"}]},"missingVariables":{"type":"array","items":{"type":"string"}},"unknownVariables":{"type":"array","items":{"type":"string"}}},"required":["text","caption","missingVariables","unknownVariables"],"additionalProperties":false},"RenderCampaignPreviewRequest":{"type":"object","properties":{"message":{"$ref":"#/components/schemas/CampaignMessage"},"contactId":{"description":"Defaults to sample values.","type":"string"}},"required":["message"]},"ResumeCampaignRequest":{"type":"object","properties":{"reassignInstanceIds":{"description":"Move pending recipients of unavailable numbers to these numbers.","minItems":1,"maxItems":25,"type":"array","items":{"type":"string"}}}},"ScoringPreview":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"leadId":{"type":"string"},"currentScore":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"score":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currentQualification":{"type":"string"},"qualification":{"type":"string"},"matched":{"type":"array","items":{"type":"object","properties":{"ruleId":{"type":"string"},"name":{"type":"string"},"points":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["ruleId","name","points"],"additionalProperties":false}}},"required":["leadId","currentScore","score","currentQualification","qualification","matched"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false},"ScoringPreviewRequest":{"type":"object","properties":{"rules":{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/CreateScoringRuleRequest"}}}},"ScoringRule":{"type":"object","properties":{"id":{"type":"string","example":"srl_01jq8x7y2z3a4b5c6d7e8f9g0h"},"name":{"type":"string"},"condition":{"$ref":"#/components/schemas/LeadRule_Output"},"points":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"active":{"type":"boolean"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["id","name","condition","points","active","position","createdAt","updatedAt"],"additionalProperties":false},"ScoringRuleList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ScoringRule"}}},"required":["data"],"additionalProperties":false},"Segment":{"type":"object","properties":{"id":{"type":"string","example":"seg_01jq8x7y2z3a4b5c6d7e8f9g0h"},"projectId":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"rule":{"$ref":"#/components/schemas/SegmentRule_Output"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["id","projectId","name","description","rule","createdAt","updatedAt"],"additionalProperties":false},"SegmentList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Segment"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"],"additionalProperties":false},"SegmentPreview":{"type":"object","properties":{"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Matching contacts (capped, see `capped`)."},"capped":{"type":"boolean"},"consentMode":{"type":"string","enum":["opt_in","opt_out"]},"breakdown":{"type":"object","properties":{"eligible":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"optedOut":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"noConsent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"noAddress":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["eligible","optedOut","noConsent","noAddress"],"additionalProperties":false,"description":"How many matching contacts a campaign would message under the current consent mode."},"sample":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"ct_01jq8x7y2z3a4b5c6d7e8f9g0h"},"name":{"type":"string","description":"Display name, else the WhatsApp profile name, else the phone number."},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"E.164 digits when known (WhatsApp may hide it behind a LID)."},"consent":{"$ref":"#/components/schemas/ContactConsent"}},"required":["id","name","phone","consent"],"additionalProperties":false}}},"required":["count","capped","consentMode","breakdown","sample"],"additionalProperties":false},"SegmentPreviewRequest":{"type":"object","properties":{"rule":{"$ref":"#/components/schemas/SegmentRule"}},"required":["rule"]},"SegmentRule":{"type":"object","properties":{"type":{"type":"string","const":"group"},"op":{"type":"string","enum":["and","or"]},"negate":{"type":"boolean"},"rules":{"minItems":1,"maxItems":50,"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/SegmentRule"},{"type":"object","properties":{"type":{"type":"string","const":"tag"},"op":{"type":"string","enum":["has_any","has_all","has_none"]},"tagIds":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string"}}},"required":["type","op","tagIds"]},{"type":"object","properties":{"type":{"type":"string","const":"attribute"},"key":{"type":"string","pattern":"^[A-Za-z0-9_.-]{1,64}$"},"op":{"type":"string","enum":["eq","neq","contains","not_contains","exists","not_exists","gt","gte","lt","lte","in","not_in"]},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}]},{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}]}}]}},"required":["type","key","op"]},{"type":"object","properties":{"type":{"type":"string","const":"consent"},"op":{"type":"string","enum":["is","is_not"]},"value":{"$ref":"#/components/schemas/ConsentStatus"}},"required":["type","op","value"]},{"type":"object","properties":{"type":{"type":"string","enum":["created_at","last_inbound_at"]},"op":{"type":"string","enum":["before","after","within_days","not_within_days","exists","not_exists"]},"value":{"description":"A timestamp for before/after, a number of days for within_days/not_within_days.","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"integer","minimum":1,"maximum":3650}]}},"required":["type","op"]},{"type":"object","properties":{"type":{"type":"string","const":"conversation"},"op":{"type":"string","enum":["exists","not_exists"]},"instanceId":{"description":"Only conversations on this instance.","type":"string"}},"required":["type","op"]},{"type":"object","properties":{"type":{"type":"string","const":"phone"},"op":{"type":"string","const":"starts_with"},"value":{"type":"string","pattern":"^\\d{1,6}$"}},"required":["type","op","value"]},{"type":"object","properties":{"type":{"type":"string","const":"import"},"importId":{"type":"string"}},"required":["type","importId"]}]}}},"required":["type","op","rules"],"description":"A group of conditions combined with `and`/`or` (optionally negated). Conditions: tag, attribute, consent, created_at, last_inbound_at, conversation, phone, import, or a nested group. See the campaigns guide."},"SegmentRule_Output":{"type":"object","properties":{"type":{"type":"string","const":"group"},"op":{"type":"string","enum":["and","or"]},"negate":{"type":"boolean"},"rules":{"minItems":1,"maxItems":50,"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/SegmentRule_Output"},{"type":"object","properties":{"type":{"type":"string","const":"tag"},"op":{"type":"string","enum":["has_any","has_all","has_none"]},"tagIds":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string"}}},"required":["type","op","tagIds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"attribute"},"key":{"type":"string","pattern":"^[A-Za-z0-9_.-]{1,64}$"},"op":{"type":"string","enum":["eq","neq","contains","not_contains","exists","not_exists","gt","gte","lt","lte","in","not_in"]},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}]},{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}]}}]}},"required":["type","key","op"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"consent"},"op":{"type":"string","enum":["is","is_not"]},"value":{"$ref":"#/components/schemas/ConsentStatus"}},"required":["type","op","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["created_at","last_inbound_at"]},"op":{"type":"string","enum":["before","after","within_days","not_within_days","exists","not_exists"]},"value":{"description":"A timestamp for before/after, a number of days for within_days/not_within_days.","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"integer","minimum":1,"maximum":3650}]}},"required":["type","op"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"conversation"},"op":{"type":"string","enum":["exists","not_exists"]},"instanceId":{"description":"Only conversations on this instance.","type":"string"}},"required":["type","op"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"phone"},"op":{"type":"string","const":"starts_with"},"value":{"type":"string","pattern":"^\\d{1,6}$"}},"required":["type","op","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"import"},"importId":{"type":"string"}},"required":["type","importId"],"additionalProperties":false}]}}},"required":["type","op","rules"],"additionalProperties":false,"description":"A group of conditions combined with `and`/`or` (optionally negated). Conditions: tag, attribute, consent, created_at, last_inbound_at, conversation, phone, import, or a nested group. See the campaigns guide."},"SendMessageRequest":{"oneOf":[{"type":"object","properties":{"instanceId":{"type":"string","example":"wa_01jq8x7y2z3a4b5c6d7e8f9g0h"},"recipient":{"type":"string","minLength":5,"maxLength":32,"description":"Recipient phone number in international format, with or without \"+\" (for example 923001234567 or +923001234567). Group chats are not supported.","example":"923001234567"},"clientReference":{"description":"Your own reference for this message, returned in responses and webhooks.","example":"attendance-987","type":"string","maxLength":200},"metadata":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]},"description":"Up to 20 key/value pairs for your own bookkeeping. Returned as-is."},"expiresInSeconds":{"description":"Give up (status FAILED, code EXPIRED) if the message cannot be sent within this time. Default 24 hours.","type":"integer","minimum":60,"maximum":604800},"type":{"type":"string","const":"text"},"content":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":4096,"example":"Your child was marked absent today."}},"required":["text"]}},"required":["instanceId","recipient","type","content"]},{"type":"object","properties":{"instanceId":{"type":"string","example":"wa_01jq8x7y2z3a4b5c6d7e8f9g0h"},"recipient":{"type":"string","minLength":5,"maxLength":32,"description":"Recipient phone number in international format, with or without \"+\" (for example 923001234567 or +923001234567). Group chats are not supported.","example":"923001234567"},"clientReference":{"description":"Your own reference for this message, returned in responses and webhooks.","example":"attendance-987","type":"string","maxLength":200},"metadata":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]},"description":"Up to 20 key/value pairs for your own bookkeeping. Returned as-is."},"expiresInSeconds":{"description":"Give up (status FAILED, code EXPIRED) if the message cannot be sent within this time. Default 24 hours.","type":"integer","minimum":60,"maximum":604800},"type":{"type":"string","const":"image"},"content":{"type":"object","properties":{"mediaId":{"type":"string","description":"ID returned by POST /v1/media."},"caption":{"type":"string","maxLength":1024}},"required":["mediaId"]}},"required":["instanceId","recipient","type","content"]},{"type":"object","properties":{"instanceId":{"type":"string","example":"wa_01jq8x7y2z3a4b5c6d7e8f9g0h"},"recipient":{"type":"string","minLength":5,"maxLength":32,"description":"Recipient phone number in international format, with or without \"+\" (for example 923001234567 or +923001234567). Group chats are not supported.","example":"923001234567"},"clientReference":{"description":"Your own reference for this message, returned in responses and webhooks.","example":"attendance-987","type":"string","maxLength":200},"metadata":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]},"description":"Up to 20 key/value pairs for your own bookkeeping. Returned as-is."},"expiresInSeconds":{"description":"Give up (status FAILED, code EXPIRED) if the message cannot be sent within this time. Default 24 hours.","type":"integer","minimum":60,"maximum":604800},"type":{"type":"string","const":"document"},"content":{"type":"object","properties":{"mediaId":{"type":"string","description":"ID returned by POST /v1/media."},"fileName":{"description":"File name shown to the recipient.","type":"string","minLength":1,"maxLength":200},"caption":{"type":"string","maxLength":1024}},"required":["mediaId"]}},"required":["instanceId","recipient","type","content"]}]},"SendMessageResponse":{"type":"object","properties":{"id":{"type":"string"},"status":{"$ref":"#/components/schemas/MessageStatus"},"instanceId":{"type":"string"},"clientReference":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["id","status","instanceId","clientReference","createdAt"],"additionalProperties":false},"SetContactTagsRequest":{"type":"object","properties":{"tagIds":{"maxItems":50,"type":"array","items":{"type":"string"}}},"required":["tagIds"]},"SetConversationTagsRequest":{"type":"object","properties":{"tagIds":{"maxItems":20,"type":"array","items":{"type":"string"}}},"required":["tagIds"]},"StageKind":{"type":"string","enum":["open","won","lost"]},"StartConversationRequest":{"oneOf":[{"type":"object","properties":{"instanceId":{"type":"string"},"recipient":{"type":"string","minLength":5,"maxLength":32,"description":"Recipient phone number in international format, with or without \"+\" (for example 923001234567 or +923001234567). Group chats are not supported.","example":"923001234567"},"type":{"type":"string","const":"text"},"content":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":4096,"example":"Your child was marked absent today."}},"required":["text"]}},"required":["instanceId","recipient","type","content"]},{"type":"object","properties":{"instanceId":{"type":"string"},"recipient":{"type":"string","minLength":5,"maxLength":32,"description":"Recipient phone number in international format, with or without \"+\" (for example 923001234567 or +923001234567). Group chats are not supported.","example":"923001234567"},"type":{"type":"string","const":"image"},"content":{"type":"object","properties":{"mediaId":{"type":"string","description":"ID returned by POST /v1/media."},"caption":{"type":"string","maxLength":1024}},"required":["mediaId"]}},"required":["instanceId","recipient","type","content"]},{"type":"object","properties":{"instanceId":{"type":"string"},"recipient":{"type":"string","minLength":5,"maxLength":32,"description":"Recipient phone number in international format, with or without \"+\" (for example 923001234567 or +923001234567). Group chats are not supported.","example":"923001234567"},"type":{"type":"string","const":"document"},"content":{"type":"object","properties":{"mediaId":{"type":"string","description":"ID returned by POST /v1/media."},"fileName":{"description":"File name shown to the recipient.","type":"string","minLength":1,"maxLength":200},"caption":{"type":"string","maxLength":1024}},"required":["mediaId"]}},"required":["instanceId","recipient","type","content"]}]},"StartConversationResponse":{"type":"object","properties":{"conversationId":{"type":"string"},"instanceId":{"type":"string"}},"required":["conversationId","instanceId"],"additionalProperties":false},"Tag":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["id","name","color"],"additionalProperties":false},"TagList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Tag"}}},"required":["data"],"additionalProperties":false},"TestCampaignRequest":{"type":"object","properties":{"contactId":{"type":"string"},"instanceId":{"description":"Defaults to the campaign’s first number.","type":"string"}},"required":["contactId"]},"TestCampaignResponse":{"type":"object","properties":{"messageId":{"type":"string"}},"required":["messageId"],"additionalProperties":false},"TimelineItem":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"message"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"message":{"type":"object","properties":{"id":{"type":"string"},"direction":{"type":"string","enum":["outbound","inbound"]},"type":{"type":"string"},"status":{"$ref":"#/components/schemas/MessageStatus"},"source":{"anyOf":[{"$ref":"#/components/schemas/MessageOrigin"},{"type":"null"}]},"author":{"anyOf":[{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"}},"required":["userId","name"],"additionalProperties":false},{"type":"null"}]},"content":{"anyOf":[{"$ref":"#/components/schemas/MessageContent"},{"type":"null"}]},"contentPurged":{"type":"boolean"},"failure":{"anyOf":[{"type":"object","properties":{"code":{"$ref":"#/components/schemas/MessageFailureCode"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"sentAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"deliveredAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"readAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]}},"required":["id","direction","type","status","source","author","content","contentPurged","failure","createdAt","sentAt","deliveredAt","readAt"],"additionalProperties":false}},"required":["kind","at","message"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"note"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"note":{"type":"object","properties":{"id":{"type":"string"},"conversationId":{"type":"string"},"author":{"anyOf":[{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"}},"required":["userId","name"],"additionalProperties":false},{"type":"null"}]},"body":{"type":"string"},"mentions":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"editedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]}},"required":["id","conversationId","author","body","mentions","createdAt","editedAt"],"additionalProperties":false}},"required":["kind","at","note"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"activity"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"activity":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["created","assigned","unassigned","team_changed","status_changed","priority_changed","tags_changed","reopened","auto_replied","sla_breached","merged","ai_replied","ai_handoff","ai_paused","ai_resumed","consent_changed","followup_started","followup_sent","followup_stopped"]},"actor":{"type":"object","properties":{"type":{"type":"string","enum":["user","api_key","system"]},"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["type","id","label"],"additionalProperties":false},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["id","type","actor","data","createdAt"],"additionalProperties":false}},"required":["kind","at","activity"],"additionalProperties":false}]},"TransitionLeadRequest":{"type":"object","properties":{"status":{"type":"string","enum":["new","working","qualified","unqualified","archived"]},"reason":{"description":"Why the lead was disqualified or archived.","type":"string","maxLength":500},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["status"]},"UpdateAssignmentRuleRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"condition":{"$ref":"#/components/schemas/LeadRule"},"strategy":{"$ref":"#/components/schemas/AssignmentStrategy"},"targetUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"targetTeamId":{"anyOf":[{"type":"string"},{"type":"null"}]},"active":{"type":"boolean"},"position":{"type":"integer","minimum":0,"maximum":10000}}},"UpdateCampaignRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"segmentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"audience":{"description":"Inline rule, used when no segment is set.","anyOf":[{"$ref":"#/components/schemas/SegmentRule"},{"type":"null"}]},"message":{"$ref":"#/components/schemas/CampaignMessage"},"instanceIds":{"maxItems":25,"type":"array","items":{"type":"string"}},"instanceStrategy":{"$ref":"#/components/schemas/CampaignInstanceStrategy"},"sendDelayMs":{"anyOf":[{"type":"integer","minimum":0,"maximum":600000},{"type":"null"}]},"messageTtlSeconds":{"anyOf":[{"type":"integer","minimum":300,"maximum":604800},{"type":"null"}]},"skipIfMissingVariables":{"type":"boolean"},"timezone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"followUpSequenceId":{"description":"Enroll every recipient in this active `no_reply` sequence when their campaign message is queued; a reply stops it.","anyOf":[{"type":"string"},{"type":"null"}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}},"UpdateCampaignSettingsRequest":{"type":"object","properties":{"consentMode":{"$ref":"#/components/schemas/ConsentMode"},"sendDelayMs":{"type":"integer","minimum":0,"maximum":600000},"optOutKeywords":{"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"optInKeywords":{"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"optOutReply":{"type":"object","properties":{"enabled":{"type":"boolean"},"text":{"type":"string","minLength":1,"maxLength":500}},"required":["enabled","text"]},"optInReply":{"type":"object","properties":{"enabled":{"type":"boolean"},"text":{"type":"string","minLength":1,"maxLength":500}},"required":["enabled","text"]},"defaultMessageTtlSeconds":{"type":"integer","minimum":300,"maximum":604800},"acknowledgement":{"description":"Required (dashboard only) to switch to `opt_out`: confirms you have a lawful basis to message these contacts.","type":"string","maxLength":500}}},"UpdateCompanyRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"domain":{"anyOf":[{"type":"string","maxLength":253,"pattern":"^(?=.{1,253}$)([a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$"},{"type":"null"}]},"industry":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"size":{"anyOf":[{"type":"string","enum":["1-10","11-50","51-200","201-500","501-1000","1001-5000","5000+"]},{"type":"null"}]},"website":{"anyOf":[{"type":"string","maxLength":2048,"format":"uri"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"address":{"anyOf":[{"$ref":"#/components/schemas/Address"},{"type":"null"}]},"ownerUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"customFields":{"description":"Merged into existing values; null clears a field.","type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":2000},{"type":"number"},{"type":"boolean"},{"type":"null"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"externalId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"},{"type":"null"}]},"version":{"description":"Reject the update with 409 when the company changed since this version.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}},"UpdateContactRequest":{"type":"object","properties":{"displayName":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"attributes":{"description":"Replaces all attributes.","type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"externalId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"},{"type":"null"}]}}},"UpdateConversationRequest":{"type":"object","properties":{"version":{"description":"Reject with CONFLICT if the conversation changed since.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"$ref":"#/components/schemas/ConversationStatus"},"snoozedUntil":{"description":"Required with status `snoozed`.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"assigneeUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"teamId":{"anyOf":[{"type":"string"},{"type":"null"}]},"priority":{"$ref":"#/components/schemas/ConversationPriority"},"force":{"type":"boolean"}}},"UpdateCrmFieldRequest":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":80},"options":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"value":{"type":"string","minLength":1,"maxLength":100},"label":{"type":"string","minLength":1,"maxLength":100}},"required":["value","label"]}},"required":{"type":"boolean"},"aiExtractable":{"type":"boolean"},"aiHint":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"position":{"type":"integer","minimum":0,"maximum":1000},"archived":{"type":"boolean"}}},"UpdateCrmNoteRequest":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":10000}},"required":["body"]},"UpdateCrmSettingsRequest":{"type":"object","properties":{"capture":{"type":"object","properties":{"mode":{"default":"off","description":"How inbound WhatsApp messages create leads. `all_new`: every contact without an open lead. `keywords`: messages containing one of the keywords. `ai`: the AI decides whether the conversation is a sales enquiry.","$ref":"#/components/schemas/LeadCaptureMode"},"keywords":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":60}},"instanceIds":{"default":[],"description":"Only these instances; empty means all.","maxItems":200,"type":"array","items":{"type":"string"}},"reopenAfterDays":{"default":30,"description":"Do not capture a contact again within this many days of their last lead being closed.","type":"integer","minimum":0,"maximum":3650}}},"ai":{"type":"object","properties":{"extraction":{"default":false,"description":"Let the AI fill lead fields from conversations.","type":"boolean"},"classifyMinConfidence":{"default":0.7,"type":"number","minimum":0,"maximum":1},"fieldMinConfidence":{"default":0.6,"type":"number","minimum":0,"maximum":1},"reextractAfterMinutes":{"default":10,"type":"integer","minimum":1,"maximum":1440},"qualifyingQuestions":{"default":false,"description":"When AI auto-reply is on, let it ask for missing qualification details.","type":"boolean"},"maxQualificationQuestions":{"default":3,"type":"integer","minimum":1,"maximum":10},"handoffOnQualified":{"default":false,"description":"Hand the conversation to the lead owner once the lead is sales-qualified.","type":"boolean"}}},"qualification":{"type":"object","properties":{"mqlScore":{"default":30,"type":"integer","minimum":-10000,"maximum":10000},"sqlScore":{"default":60,"type":"integer","minimum":-10000,"maximum":10000},"requiredForSql":{"default":[],"description":"Standard fields (email, title, company, first_name, last_name) or custom field keys a lead needs to be sales-qualified.","maxItems":20,"type":"array","items":{"type":"string","maxLength":64}},"autoQualify":{"default":true,"description":"Move open leads to `qualified` when they become sales-qualified.","type":"boolean"}}},"sla":{"type":"object","properties":{"enabled":{"default":false,"type":"boolean"},"firstResponseMinutes":{"default":15,"type":"integer","minimum":1,"maximum":10080},"businessHoursOnly":{"default":true,"description":"Count only the inbox business hours.","type":"boolean"}}},"assignment":{"type":"object","properties":{"enabled":{"default":false,"type":"boolean"},"fallback":{"default":"none","type":"string","enum":["none","round_robin","least_busy"]},"inheritConversationAssignee":{"default":true,"type":"boolean"},"maxOpenLeadsPerUser":{"default":null,"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"null"}]}}},"visibility":{"type":"string","enum":["all","own_team"]},"defaultCurrency":{"type":"string","pattern":"^[A-Z]{3}$","example":"USD"},"defaultPipelineId":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"UpdateCrmTaskRequest":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/CrmTaskType"},"title":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"dueAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"assigneeUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"$ref":"#/components/schemas/CrmTaskStatus"}}},"UpdateDealRequest":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"valueMinor":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Amount in the currency’s minor unit (cents for USD).","example":250000},{"type":"null"}]},"currency":{"type":"string","pattern":"^[A-Z]{3}$","example":"USD"},"expectedCloseDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"contactId":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyId":{"anyOf":[{"type":"string"},{"type":"null"}]},"ownerUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"customFields":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":2000},{"type":"number"},{"type":"boolean"},{"type":"null"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]},"description":"Values keyed by custom field key. Validated against the project field definitions."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}},"UpdateFollowUpEnrollmentRequest":{"type":"object","properties":{"anchorAt":{"description":"Reschedule: steps not yet run are recomputed from the new date.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"timezone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"variables":{"description":"Replaces all variables.","type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z0-9_]{1,64}$"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}]}}}},"UpdateFollowUpRuleRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"sequenceId":{"type":"string"},"trigger":{"$ref":"#/components/schemas/FollowUpTrigger"},"conditions":{"anyOf":[{"$ref":"#/components/schemas/SegmentRule"},{"type":"null"}]},"anchor":{"$ref":"#/components/schemas/FollowUpRuleAnchor"},"enabled":{"type":"boolean"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}},"UpdateFollowUpSequenceRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"definition":{"$ref":"#/components/schemas/FollowUpDefinition"},"version":{"description":"Rejects the update with 409 when the sequence changed since this version.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}},"UpdateFollowUpSettingsRequest":{"type":"object","properties":{"timezone":{"type":"string","maxLength":64},"sendWindow":{"type":"object","properties":{"enabled":{"default":false,"type":"boolean"},"days":{"default":[{"day":1,"open":"09:00","close":"17:00"},{"day":2,"open":"09:00","close":"17:00"},{"day":3,"open":"09:00","close":"17:00"},{"day":4,"open":"09:00","close":"17:00"},{"day":5,"open":"09:00","close":"17:00"}],"maxItems":28,"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":0,"maximum":6},"open":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"close":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["day","open","close"]}},"holidays":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}}}},"maxPerContactPerDay":{"type":"integer","minimum":1,"maximum":20},"sendDelayMs":{"type":"integer","minimum":0,"maximum":600000},"consentMode":{"$ref":"#/components/schemas/ConsentMode"},"defaultInstanceId":{"anyOf":[{"type":"string"},{"type":"null"}]},"defaultMessageTtlSeconds":{"type":"integer","minimum":300,"maximum":604800},"retentionDays":{"type":"integer","minimum":7,"maximum":730}}},"UpdateInstanceRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"metadata":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]},"description":"Up to 20 key/value pairs for your own bookkeeping. Returned as-is."}}},"UpdateLeadFormRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"status":{"type":"string","enum":["active","paused"]},"title":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"submitLabel":{"type":"string","minLength":1,"maxLength":40},"fields":{"minItems":1,"maxItems":30,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":100},"target":{"type":"string","enum":["first_name","last_name","full_name","email","phone","title","company","message","custom"]},"customKey":{"description":"Lead custom field filled by this input (target `custom`).","type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"type":{"default":"text","type":"string","enum":["text","textarea","email","tel","number","select","checkbox","date"]},"required":{"default":false,"type":"boolean"},"placeholder":{"type":"string","maxLength":120},"options":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"value":{"type":"string","minLength":1,"maxLength":100},"label":{"type":"string","minLength":1,"maxLength":100}},"required":["value","label"]}}},"required":["name","label","target"]}},"consent":{"type":"object","properties":{"enabled":{"type":"boolean"},"text":{"type":"string","maxLength":1000},"required":{"type":"boolean"}},"required":["enabled","text","required"]},"successMessage":{"type":"string","minLength":1,"maxLength":500},"redirectUrl":{"anyOf":[{"type":"string","maxLength":2048,"format":"uri"},{"type":"null"}]},"allowedOrigins":{"maxItems":20,"type":"array","items":{"type":"string","pattern":"^https?:\\/\\/[^/\\s]+$"}},"instanceId":{"anyOf":[{"type":"string"},{"type":"null"}]},"ownerUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"tagIds":{"maxItems":20,"type":"array","items":{"type":"string"}}}},"UpdateLeadLinkRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"prefillText":{"type":"string","minLength":1,"maxLength":500},"utm":{"$ref":"#/components/schemas/Utm"},"active":{"type":"boolean"},"ownerUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"tagIds":{"maxItems":20,"type":"array","items":{"type":"string"}}}},"UpdateLeadRequest":{"type":"object","properties":{"firstName":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"title":{"anyOf":[{"type":"string","maxLength":150},{"type":"null"}]},"companyId":{"anyOf":[{"type":"string"},{"type":"null"}]},"customFields":{"description":"Merged into existing values; null clears a field.","type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":2000},{"type":"number"},{"type":"boolean"},{"type":"null"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"qualification":{"description":"Override the score-based qualification; null returns it to scoring.","anyOf":[{"$ref":"#/components/schemas/QualificationLevel"},{"type":"null"}]},"externalId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"},{"type":"null"}]},"version":{"description":"Reject the update with 409 when the lead changed since this version.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}},"UpdatePipelineRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"isDefault":{"type":"boolean","const":true},"archived":{"type":"boolean"},"stages":{"description":"The full ordered stage list. Stages left out are removed; their deals move to `moveDealsTo`.","minItems":3,"maxItems":20,"type":"array","items":{"type":"object","properties":{"id":{"description":"Existing stage to keep; omit for a new stage.","type":"string"},"name":{"type":"string","minLength":1,"maxLength":60},"probability":{"type":"integer","minimum":0,"maximum":100},"kind":{"default":"open","$ref":"#/components/schemas/StageKind"},"rottenAfterDays":{"anyOf":[{"type":"integer","minimum":1,"maximum":3650},{"type":"null"}]}},"required":["name"]}},"moveDealsTo":{"description":"Removed stage ID -> stage ID that takes over its deals.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}}},"UpdateScoringRuleRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"condition":{"$ref":"#/components/schemas/LeadRule"},"points":{"type":"integer","minimum":-1000,"maximum":1000},"active":{"type":"boolean"},"position":{"type":"integer","minimum":0,"maximum":10000}}},"UpdateSegmentRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"rule":{"$ref":"#/components/schemas/SegmentRule"}}},"UpdateTagRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":40},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}}},"UpdateWebhookRequest":{"type":"object","properties":{"url":{"type":"string","maxLength":2048,"format":"uri","description":"HTTPS endpoint (HTTP is only accepted in development deployments). Private network addresses are rejected.","example":"https://api.example.com/whatstig/webhooks"},"events":{"minItems":1,"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/WebhookEventType"},{"type":"string","const":"*"}]},"description":"Event types to deliver, or [\"*\"] for all."},"description":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"enabled":{"type":"boolean"}}},"UpsertContactRequest":{"type":"object","properties":{"phone":{"type":"string","minLength":5,"maxLength":32,"description":"Recipient phone number in international format, with or without \"+\" (for example 923001234567 or +923001234567). Group chats are not supported.","example":"923001234567"},"externalId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"},"displayName":{"type":"string","maxLength":120},"attributes":{"description":"Merged into existing attributes.","type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"notes":{"type":"string","maxLength":4000},"tagIds":{"description":"Added to the contact (existing tags are kept).","maxItems":20,"type":"array","items":{"type":"string"}},"consent":{"description":"Record that this person opted in. Ignored (and reported) when the contact has opted out.","$ref":"#/components/schemas/ConsentInput"}},"required":["phone"]},"UpsertContactResponse":{"type":"object","properties":{"contact":{"$ref":"#/components/schemas/Contact"},"created":{"type":"boolean"},"consentIgnored":{"type":"boolean","description":"True when an opt-in was not applied because the contact opted out."}},"required":["contact","created","consentIgnored"],"additionalProperties":false},"UsageResponse":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"totals":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"daily":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"metric":{"type":"string"},"quantity":{"type":"number"}},"required":["date","metric","quantity"],"additionalProperties":false}},"instances":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"connected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["total","connected"],"additionalProperties":false},"entitlements":{"type":"object","properties":{"plan":{"type":"string"},"maxInstances":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"monthlyMessages":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["plan","maxInstances","monthlyMessages"],"additionalProperties":false}},"required":["from","to","totals","daily","instances","entitlements"],"additionalProperties":false},"Utm":{"type":"object","properties":{"source":{"type":"string","maxLength":200},"medium":{"type":"string","maxLength":200},"campaign":{"type":"string","maxLength":200},"term":{"type":"string","maxLength":200},"content":{"type":"string","maxLength":200}}},"Utm_Output":{"type":"object","properties":{"source":{"type":"string","maxLength":200},"medium":{"type":"string","maxLength":200},"campaign":{"type":"string","maxLength":200},"term":{"type":"string","maxLength":200},"content":{"type":"string","maxLength":200}},"additionalProperties":false},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string","example":"dlv_01jq8x7y2z3a4b5c6d7e8f9g0h"},"webhookId":{"type":"string"},"eventId":{"type":"string"},"eventType":{"$ref":"#/components/schemas/WebhookEventType"},"status":{"type":"string","enum":["pending","succeeded","failed","dead"],"description":"`failed` is retrying, `dead` exhausted all retries and can be replayed manually."},"attemptCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastResponseStatus":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"lastError":{"anyOf":[{"type":"string"},{"type":"null"}]},"nextAttemptAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"deliveredAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["id","webhookId","eventId","eventType","status","attemptCount","lastResponseStatus","lastError","nextAttemptAt","deliveredAt","createdAt"],"additionalProperties":false},"WebhookDeliveryAttempt":{"type":"object","properties":{"attempt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"responseStatus":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"durationMs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["attempt","responseStatus","error","durationMs","createdAt"],"additionalProperties":false},"WebhookDeliveryDetail":{"type":"object","properties":{"id":{"type":"string","example":"dlv_01jq8x7y2z3a4b5c6d7e8f9g0h"},"webhookId":{"type":"string"},"eventId":{"type":"string"},"eventType":{"$ref":"#/components/schemas/WebhookEventType"},"status":{"type":"string","enum":["pending","succeeded","failed","dead"],"description":"`failed` is retrying, `dead` exhausted all retries and can be replayed manually."},"attemptCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastResponseStatus":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"lastError":{"anyOf":[{"type":"string"},{"type":"null"}]},"nextAttemptAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"deliveredAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"attempts":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDeliveryAttempt"}},"event":{"$ref":"#/components/schemas/WebhookEvent"}},"required":["id","webhookId","eventId","eventType","status","attemptCount","lastResponseStatus","lastError","nextAttemptAt","deliveredAt","createdAt","attempts","event"],"additionalProperties":false},"WebhookDeliveryList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"],"additionalProperties":false},"WebhookEndpoint":{"type":"object","properties":{"id":{"type":"string","example":"whk_01jq8x7y2z3a4b5c6d7e8f9g0h"},"projectId":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["active","disabled"]},"disabledReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"secretPreview":{"type":"string","description":"Last 4 characters of the signing secret."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["id","projectId","url","events","description","status","disabledReason","secretPreview","createdAt","updatedAt"],"additionalProperties":false},"WebhookEndpointList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}}},"required":["data"],"additionalProperties":false},"WebhookEndpointWithSecret":{"type":"object","properties":{"id":{"type":"string","example":"whk_01jq8x7y2z3a4b5c6d7e8f9g0h"},"projectId":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["active","disabled"]},"disabledReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"secretPreview":{"type":"string","description":"Last 4 characters of the signing secret."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"secret":{"type":"string","description":"Signing secret. Shown only once, at creation or rotation."}},"required":["id","projectId","url","events","description","status","disabledReason","secretPreview","createdAt","updatedAt","secret"],"additionalProperties":false},"WebhookEvent":{"type":"object","properties":{"id":{"type":"string","example":"evt_01jq8x7y2z3a4b5c6d7e8f9g0h"},"type":{"$ref":"#/components/schemas/WebhookEventType"},"apiVersion":{"type":"string","const":"v1"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"},"projectId":{"type":"string"},"instanceId":{"anyOf":[{"type":"string"},{"type":"null"}]},"externalReference":{"anyOf":[{"type":"string"},{"type":"null"}]},"data":{"anyOf":[{"type":"object","properties":{"status":{"$ref":"#/components/schemas/InstanceStatus"},"reasonCode":{"anyOf":[{"$ref":"#/components/schemas/InstanceReasonCode"},{"type":"null"}]},"phoneNumber":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["status","reasonCode","phoneNumber"],"additionalProperties":false},{"type":"object","properties":{"messageId":{"type":"string"},"status":{"$ref":"#/components/schemas/MessageStatus"},"direction":{"type":"string","enum":["outbound","inbound"]},"clientReference":{"anyOf":[{"type":"string"},{"type":"null"}]},"recipient":{"anyOf":[{"type":"string"},{"type":"null"}]},"sender":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"type":"string"},"providerMessageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"failure":{"anyOf":[{"type":"object","properties":{"code":{"$ref":"#/components/schemas/MessageFailureCode"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false},{"type":"null"}]},"content":{"anyOf":[{"type":"object","properties":{"text":{"type":"string"},"caption":{"type":"string"},"mediaId":{"type":"string"},"mimeType":{"type":"string"},"fileName":{"type":"string"}},"additionalProperties":false},{"type":"null"}],"description":"Included for message.received when the project retains message content."},"campaignId":{"description":"Set for messages sent by a campaign.","anyOf":[{"type":"string"},{"type":"null"}]},"followUpEnrollmentId":{"description":"Set for messages sent by a follow-up sequence.","anyOf":[{"type":"string"},{"type":"null"}]},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["messageId","status","direction","clientReference","recipient","sender","type","providerMessageId","failure","content","occurredAt"],"additionalProperties":false},{"type":"object","properties":{"campaignId":{"type":"string"},"name":{"type":"string"},"status":{"$ref":"#/components/schemas/CampaignStatus"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"stats":{"anyOf":[{"$ref":"#/components/schemas/CampaignStats"},{"type":"null"}]},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["campaignId","name","status","reason","stats","occurredAt"],"additionalProperties":false},{"type":"object","properties":{"contactId":{"type":"string"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"$ref":"#/components/schemas/ConsentStatus"},"source":{"$ref":"#/components/schemas/ConsentSource"},"keyword":{"anyOf":[{"type":"string"},{"type":"null"}]},"messageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["contactId","phone","status","source","keyword","messageId","occurredAt"],"additionalProperties":false},{"type":"object","properties":{"object":{"type":"string","enum":["lead","deal","company","task"]},"id":{"type":"string"},"leadId":{"anyOf":[{"type":"string"},{"type":"null"}]},"dealId":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyId":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactId":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"anyOf":[{"type":"string"},{"type":"null"}]},"previousStatus":{"anyOf":[{"type":"string"},{"type":"null"}]},"qualification":{"anyOf":[{"$ref":"#/components/schemas/QualificationLevel"},{"type":"null"}]},"score":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"stageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"previousStageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"pipelineId":{"anyOf":[{"type":"string"},{"type":"null"}]},"ownerUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"anyOf":[{"$ref":"#/components/schemas/LeadSource"},{"type":"null"}]},"valueMinor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"currency":{"anyOf":[{"type":"string"},{"type":"null"}]},"changes":{"description":"Names of changed fields (values are not included).","type":"array","items":{"type":"string"}},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["object","id","occurredAt"],"additionalProperties":false},{"type":"object","properties":{"enrollmentId":{"type":"string"},"sequenceId":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactId":{"type":"string"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"$ref":"#/components/schemas/FollowUpEnrollmentStatus"},"stepIndex":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stepId":{"anyOf":[{"type":"string"},{"type":"null"}]},"messageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"$ref":"#/components/schemas/FollowUpEnrollmentSource"},"externalReference":{"anyOf":[{"type":"string"},{"type":"null"}]},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2026-10-08T12:00:00.000Z"}},"required":["enrollmentId","sequenceId","contactId","phone","status","stepIndex","stepId","messageId","reason","source","externalReference","occurredAt"],"additionalProperties":false},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}},"required":["id","type","apiVersion","createdAt","projectId","instanceId","externalReference","data"],"additionalProperties":false},"WebhookEventType":{"type":"string","enum":["instance.connected","instance.disconnected","instance.qr_required","instance.logged_out","instance.error","message.queued","message.sent","message.delivered","message.read","message.failed","message.unknown","message.received","conversation.created","conversation.assigned","conversation.status_changed","contact.opted_out","contact.opted_in","campaign.started","campaign.paused","campaign.resumed","campaign.completed","campaign.cancelled","campaign.failed","lead.created","lead.updated","lead.status_changed","lead.qualified","lead.assigned","lead.converted","lead.sla_breached","deal.created","deal.updated","deal.stage_changed","deal.won","deal.lost","company.created","company.updated","task.created","task.due","task.completed","followup.enrolled","followup.step_queued","followup.completed","followup.stopped","followup.failed","webhook.test"]}}}}