1. Rotate token
Owners and admins create or rotate a line token from the selected WhatsApp line.
curl -X POST https://app.ezw.solutions/api/lines/{lineId}/api-token \
-H "Authorization: Bearer {idToken}"
EZWUse the EZW Channel API to check one WhatsApp line at a time with a line-scoped bearer token. Workspace endpoints support token rotation, owner control, inbox operations, and admin setup.
The current public contract is the Channel API v1 health endpoint. Owners and admins create or rotate a token from a line in the workspace, then integrations call the v1 endpoint with that line token.
https://app.ezw.solutions/api/v1Authorization: Bearer {lineApiToken}One token, one WhatsApp lineGET /healthOwners and admins create or rotate a line token from the selected WhatsApp line.
curl -X POST https://app.ezw.solutions/api/lines/{lineId}/api-token \
-H "Authorization: Bearer {idToken}"Call the v1 health endpoint with the line API token. Use wakeup=false for a read-only check.
curl -X GET 'https://app.ezw.solutions/api/v1/health?wakeup=false&channel_type=web' \
-H "Authorization: Bearer {lineApiToken}"Use both the channel status and EZW line states instead of flattening health to connected/disconnected.
{
"health": {
"status": {
"code": 4,
"text": "AUTH"
}
},
"line": {
"lifecycleState": "connected",
"effectiveSendState": "sendable",
"sendable": true
}
}The first operation is the public line-scoped API. Token creation and broader workspace routes use a workspace user bearer token and exist to control who can issue access for each line.
Check the WhatsApp line attached to the bearer token and optionally request a safe wakeup.
https://app.ezw.solutions/api/v1/health| Name | In | Type | Required | Details |
|---|---|---|---|---|
Authorization | header | Bearer token | Required | Use Authorization: Bearer {lineApiToken}. Tokens start with ezw_line_ and resolve to one line. |
wakeup | query | boolean | Optional | true by default. Use false for a read-only health check. |
channel_type | query | web | mobile | Optional | Defaults to web. Used to identify the client surface making the check. |
platform | query | string | Optional | Client platform label, for example Desktop,Mac OS,15.0. |
200Health returned for the token's line. A wakeup command can be included when requested.
400wakeup is not true/false or channel_type is not web/mobile.
401Line API token is missing, invalid, revoked, or detached from an active line.
501PostgreSQL source of truth is not configured.
Read whether a line already has an active Channel API token and when it was last used.
https://app.ezw.solutions/api/lines/{lineId}/api-token| Name | In | Type | Required | Details |
|---|---|---|---|---|
Authorization | header | Bearer token | Required | Use Authorization: Bearer {idToken} from workspace login. |
lineId | path | string | Required | Existing line id in the authenticated organization. |
200Token metadata returned. token can be null when no active token exists.
403Active organization membership with line management permission is required.
404Line was not found in the authenticated organization.
501PostgreSQL source of truth is not configured.
Create a new line-scoped bearer token and revoke any previous active token for that line.
https://app.ezw.solutions/api/lines/{lineId}/api-token| Name | In | Type | Required | Details |
|---|---|---|---|---|
Authorization | header | Bearer token | Required | Use Authorization: Bearer {idToken} from workspace login. |
lineId | path | string | Required | Existing line id in the authenticated organization. |
201Token rotated. Copy lineApiToken from this response; it is shown on creation/rotation.
403Active organization membership with line management permission is required.
404Line was not found in the authenticated organization.
501PostgreSQL source of truth is not configured.
Exchange a workspace email and password for an ID token used by the customer workspace API.
https://app.ezw.solutions/api/auth/login| Name | In | Type | Required | Details |
|---|---|---|---|---|
email | body | string | Required | Workspace user email address. |
password | body | string | Required | Workspace password. Omit only when completing a new-password challenge. |
session | body | string | Optional | Cognito challenge session returned by a previous login attempt. |
newPassword | body | string | Optional | Required only when session is present for NEW_PASSWORD_REQUIRED. |
200Authenticated. Use idToken as the bearer token.
400Email and password, or challenge session and new password, are missing.
409A Cognito challenge must be completed before sign-in succeeds.
503Cognito login is not configured for the deployment.
Return WhatsApp lines visible to the authenticated operator, including lifecycle and sendability state.
https://app.ezw.solutions/api/lines| Name | In | Type | Required | Details |
|---|---|---|---|---|
Authorization | header | Bearer token | Required | Use Authorization: Bearer {idToken}. |
limit | query | integer | Optional | Positive integer limiting the number of returned lines. |
lineId | query | string | Optional | Restrict the result to one line visible to the caller. |
200Visible lines returned for the caller.
400limit is present but not a positive integer.
403The authenticated actor cannot list workspace lines.
501PostgreSQL source of truth is not configured.
Queue a QR pairing command for an existing line when the workspace and actor are eligible.
https://app.ezw.solutions/api/lines/{lineId}/qr| Name | In | Type | Required | Details |
|---|---|---|---|---|
Authorization | header | Bearer token | Required | Use Authorization: Bearer {idToken}. |
lineId | path | string | Required | Existing line id in the authenticated organization. |
idempotencyKey | body | string | Optional | Caller supplied command id for retry-safe QR requests. |
200QR command accepted or already represented by the idempotency key.
403Actor, billing, line slot, or email verification rule blocks QR pairing.
404The line does not exist in the authenticated organization.
Return the current short-lived QR image data URL for an owner or admin when a QR is available.
https://app.ezw.solutions/api/lines/{lineId}/qr| Name | In | Type | Required | Details |
|---|---|---|---|---|
Authorization | header | Bearer token | Required | Use Authorization: Bearer {idToken}. |
lineId | path | string | Required | Existing line id in the authenticated organization. |
200Current pairing QR returned with no-store cache headers.
403Only owners/admins with verified email can view QR codes.
404No current QR is available or the line is not visible.
503The transient QR store is unavailable.
Return conversations visible to the authenticated operator, optionally filtered by line.
https://app.ezw.solutions/api/conversations| Name | In | Type | Required | Details |
|---|---|---|---|---|
Authorization | header | Bearer token | Required | Use Authorization: Bearer {idToken}. |
limit | query | integer | Optional | Positive integer limiting the number of returned conversations. |
lineId | query | string | Optional | Return conversations for one visible WhatsApp line. |
200Conversation summaries returned for the authenticated actor.
400limit is present but not a positive integer.
403The authenticated actor cannot list inbox conversations.
501PostgreSQL source of truth is not configured.
Assign a conversation to a team member with optimistic conflict protection.
https://app.ezw.solutions/api/conversations/{conversationId}/assign| Name | In | Type | Required | Details |
|---|---|---|---|---|
Authorization | header | Bearer token | Required | Use Authorization: Bearer {idToken}. |
conversationId | path | string | Required | Existing conversation id visible in the authenticated organization. |
targetUserId | body | string | Required | Workspace user who should own the conversation. |
expectedVersion | body | integer | Required | Current conversation version from the latest read. |
200Conversation assignment was updated.
400expectedVersion or targetUserId is invalid.
403Actor or target user is not allowed for the conversation.
404Conversation was not found in the organization.
409Conversation version changed before the assignment was applied.
501PostgreSQL source of truth is not configured.
Queue a text reply or one image attachment from a connected line to an existing conversation or direct recipient.
https://app.ezw.solutions/api/lines/{lineId}/send| Name | In | Type | Required | Details |
|---|---|---|---|---|
Authorization | header | Bearer token | Required | Use Authorization: Bearer {idToken}. |
Idempotency-Key | header | string | Required | Required for outbound sends. A body idempotencyKey is also accepted. |
lineId | path | string | Required | Line that should send the reply. |
conversationId | body/form | string | One of | Existing conversation target. Do not combine with recipientPhoneNumber. |
recipientPhoneNumber | body/form | string | One of | Direct recipient target. Do not use for cold outbound lists. |
bodyText | body/form | string | One of | Text body. Required unless media is present. |
media | form | File | Optional | Image attachment only, up to 25 MB. |
202Reply was queued or the idempotent attempt already exists.
400Missing idempotency key, target, content, or valid media.
403Actor cannot send from the requested line.
404Conversation, actor, line, or target is not visible.
409Line is not currently sendable.
501Media bucket or PostgreSQL source of truth is not configured.
Create a short-lived signed URL for archived inbound or outbound media visible to the caller.
https://app.ezw.solutions/api/attachments/{attachmentId}/url| Name | In | Type | Required | Details |
|---|---|---|---|---|
Authorization | header | Bearer token | Required | Use Authorization: Bearer {idToken}. |
attachmentId | path | string | Required | Archived attachment id. |
expiresInSeconds | query | integer | Optional | URL lifetime from 1 to 3600 seconds. Defaults to 300. |
200Signed URL returned and media view recorded.
400expiresInSeconds is outside the allowed range.
403Actor cannot view the related media.
404Attachment is not visible in the authenticated organization.
501Database or media bucket is not configured.
Open an authenticated Server-Sent Events stream for workspace refresh hints.
https://app.ezw.solutions/api/live/stream| Name | In | Type | Required | Details |
|---|---|---|---|---|
Authorization | header | Bearer token | Required | Use Authorization: Bearer {idToken}. |
200SSE stream opened.
401Bearer token is missing or invalid.
501Redis live-update configuration is missing.
500Redis live-update configuration is invalid or unavailable.
Channel API endpoints use a line API token. Workspace endpoints require an organization principal and are scoped by organization, actor role, line visibility, and conversation assignment rules.
Line-scoped bearer-token endpoints for WhatsApp channel health.
/api/v1/healthCheck one line's health and optionally request a safe wakeup.
/api/lines/{lineId}/api-tokenRead active line API token metadata from the owner/admin workspace.
/api/lines/{lineId}/api-tokenCreate or rotate the line-scoped Channel API bearer token.
Sign in, refresh a session, and inspect the current principal.
/api/auth/loginExchange workspace email and password for an ID token.
/api/auth/refreshExchange a refresh token for a fresh ID token.
/api/auth/sessionValidate the bearer token and return the authenticated principal.
Create the first organization record before billing and line setup.
/api/signup/organizationCreate an organization, owner user, pending billing state, and allocated line slots.
Create, connect, inspect, assign, restrict, and archive WhatsApp numbers.
/api/linesList visible WhatsApp lines with lifecycle and sendability state.
/api/linesCreate a line and queue QR pairing for the new number.
/api/lines/{lineId}/qrRequest a fresh QR pairing command for an existing line.
/api/lines/{lineId}/qrRead the current short-lived QR image data URL when one is available.
/api/lines/{lineId}/assignmentSet or clear the default assignee for conversations on a line.
/api/lines/{lineId}/permissionsList explicit staff permissions for one line.
/api/lines/{lineId}/permissions/{targetUserId}Set whether a staff member can view and send from a line.
/api/lines/{lineId}/permissions/{targetUserId}Clear explicit permissions back to the workspace default.
/api/lines/{lineId}/archiveArchive a line and stop it from being used for new work.
Read conversations, claim ownership, assign staff, edit contact names, and add internal notes.
/api/conversationsList conversations visible to the authenticated operator.
/api/conversations/{conversationId}/messagesRead the timeline for one conversation.
/api/conversations/{conversationId}/claimClaim an unassigned conversation using expectedVersion conflict protection.
/api/conversations/{conversationId}/assignAssign a conversation to another staff member using expectedVersion conflict protection.
/api/conversations/{conversationId}/contactUpdate the internal display name for a customer contact.
/api/conversations/{conversationId}/notesList internal-only notes for a conversation.
/api/conversations/{conversationId}/notesCreate an internal-only note that is never sent to WhatsApp.
Queue operator replies from a connected line with durable idempotency.
/api/lines/{lineId}/sendQueue a text reply or one image attachment to an existing conversation or direct recipient.
Fetch signed URLs for archived customer media without exposing storage credentials.
/api/attachments/{attachmentId}/urlCreate a short-lived signed media URL, with expiresInSeconds from 1 to 3600.
Invite staff, update roles, disable users, and inspect access history.
/api/membershipsList active and invited workspace members.
/api/membershipsInvite a staff member with a supported organization role.
/api/memberships/{targetUserId}Change a member role.
/api/memberships/{targetUserId}Disable a member.
/api/audit-logsRead organization audit events, optionally filtered by eventType.
Read billing state, start recovery checkout, and subscribe to workspace changes.
/api/billing/statusRead current billing state, policy, line slots, and seat counts.
/api/billing/recovery/checkoutCreate a billing recovery checkout session when the workspace is restricted.
/api/live/streamOpen an authenticated Server-Sent Events stream for workspace updates.
A Channel API token belongs to one WhatsApp line. Rotating a token revokes the previous active token for that same line.
GET /api/v1/health defaults to wakeup=true. Use wakeup=false when the client only wants to inspect state.
Token reads and rotations require a workspace user with line management permission. Line and role permissions still apply in the owner dashboard.
The API is for line health and controlled support workflows. It does not expose campaign broadcasts, cold outbound lists, or chatbot-first automation.
400Invalid request body, query value, idempotency key, or send target.
401Missing, expired, invalid, or unconfigured workspace token or line API token.
403Authenticated user does not have the required workspace, role, or line permission.
404The scoped organization resource was not found or is not visible to the caller.
409Conflict, duplicate setup, stale expectedVersion, or non-sendable line state.
501The deployment is missing a required source-of-truth service for that endpoint.
EZW Channel API v1 currently exposes line-scoped health. Workspace endpoints manage token access and the support inbox control layer. Bulk/campaign tooling is outside this API boundary.
Request integration access