API Reference

Accounts

List accounts

Lists provider accounts in the current workspace. Account auth state is exposed through the Authentication endpoints.

GEThttps://api.unifyport.ai/v1/accounts

Supported channels

all

Before you call

Use a server-side X-Api-Key for the workspace that owns the resource. Replace every placeholder before running a sample.

Request parameters

Headers

X-Api-Key
stringrequired

Workspace API key. The workspace is resolved from this header.

Query parameters

limit
integer

Maximum accounts per page, from 1 to 100; defaults to 20 when omitted. Invalid values or repeated limit parameters return 400 invalid_request (numeric_code=10000). The value may change on subsequent pages.

minimum: 1 · maximum: 100

cursor
string

Opaque account-list cursor. Omit or pass an empty string for the first page; pass the previous data.next_cursor unchanged for subsequent pages. Valid only for the workspace where it was issued. Invalid, repeated, or cross-workspace cursor parameters return 400 invalid_request (numeric_code=10000).

Request body

This endpoint does not require a JSON request body.

Understand the result

Read accounts from data.items. If data.has_more is true, pass data.next_cursor unchanged as cursor for the next page. Query the authorization endpoint separately for an account’s authorization state.

Response 200 OK

{
  "request_id": "<REQUEST_ID>",
  "data": {
    "items": [
      {
        "id": "acc_example",
        "name": "Telegram Production",
        "provider": "telegram",
        "region": "global",
        "status": "active",
        "runtime_status": "running",
        "auth_mode": "qrcode",
        "capabilities": [
          "send_message",
          "receive_message"
        ],
        "metadata": {
          "env": "production"
        },
        "provider_account_ref": "provider-side-identifier",
        "provider_profile": {
          "id": "778899",
          "phone": "8600000000000",
          "username": "production_bot",
          "display_name": "Production Bot",
          "first_name": "Production",
          "last_name": "Bot",
          "avatar_url": "https://example.com/avatar.jpg",
          "bio": "Customer support"
        }
      }
    ],
    "has_more": false
  }
}

Response body

provider_profile
object

Channel-reported profile such as display_name. Omitted before the account is authenticated.

id
string

Channel-side account identity. WhatsApp returns an LID; it may be omitted before profile synchronization completes.

device_id
integer

Login device number, optionally returned in WhatsApp account details when the current session can be identified. It may change after reauthorization and is not a permanent device identifier.

minimum: 0 · maximum: 65535

phone
string

Normalized account phone number with spaces, hyphens, and the leading plus sign removed.

username
string

Provider-reported username, when available.

display_name
string

Account display name; for WhatsApp this is generated by preferring BusinessName and falling back to PushName.

push_name
string

PushName currently set on the WhatsApp account; other providers do not define semantics for this field.

business_name
string

WhatsApp BusinessName; omitted when the provider does not return one.

first_name
string

Provider-reported first name, when available.

last_name
string

Provider-reported last name, when available.

avatar_url
string

Provider-reported account avatar URL, when available.

bio
string

Provider-reported account biography or status text, when available.

platform
string

Login platform identifier reported by WhatsApp during pairing. Treat it as an opaque string and accept unknown values; other providers do not define this field. It is distinct from device_platform.

billing
object

Paid period, present only for wallet accounts. Wallet balance does not prove purchase.

period_start_at
string

Server paid period start.

format: date-time

period_end_at
string

Server paid period end.

format: date-time

amount_minor
integer

Immutable server amount in USD cents; use exact integers.

minimum: 1 · format: int64

currency
string

USD only.

operation_id
string

Public ID from billing.operation_id or a deletion response; reuse unchanged within the original workspace.

state
string

Billing or operation state does not prove authorization, connection or refund credit.

enum: ACTIVE, DELETING, DELETED, COMPENSATED, REVIEW

id
string

Unique account identifier (acc_...). Use it in account-scoped routes.

name
string

Human-readable account name.

provider
string

Channel identifier. Use the API value unchanged in later calls; see the enum below for the values returned by this endpoint.

enum: telegram, whatsapp, line, twitter, facebook, zalo, tiktok, whatsapp-protocol

region
string

Default network egress region selected for the account.

status
string

Account lifecycle state, such as active.

runtime_status
string

Normalized runtime state: one of unknown, starting, running, stopping, stopped, reconnecting, disconnected, or error.

enum: unknown, starting, running, stopping, stopped, reconnecting, disconnected, error

auth_mode
string

Authentication flow used by the account: code, qrcode, or session. TikTok supports qrcode and session, but does not support switching between them in place.

capabilities[]
string[]

Capabilities enabled for the account, such as send_message and receive_message.

metadata
object

Your own environment labels stored on the account.

provider_account_ref
string

Channel-side identifier you can attach to correlate the account with your own system.

proxy
object

Proxy explicitly configured by the customer; platform default egress credentials are not returned.

has_more
boolean

Whether the account list has another page.

next_cursor
string

Opaque cursor for the next account-list page, returned only when has_more=true. Pass it unchanged as cursor for the next page; omitted on the last page.

Responses

200

200 OK

Request succeeded. See the example response body.

400

Bad Request

The request body, path, or parameters are invalid.

401

Unauthorized

The X-Api-Key header is missing or invalid.

403

Forbidden

The request is authenticated but is not allowed.

404

Not Found

The requested resource was not found. Check error.code and the current operation.

500

Internal Server Error

The service encountered an unexpected error.

If the request fails

Inspect HTTP status and error.code/numeric_code, and keep request_id for diagnosis. Correct invalid parameters, complete required authorization or check runtime state as appropriate. Confirm the outcome before retrying a send or another write. Error reference

Read HTTP status, error.code and error.numeric_code together in the context of the current operation. Numeric codes are strings. Keep request_id for diagnosis; it is not an idempotency key or a task identifier.

invalid_request · 10000 · 400

Check the JSON body and required fields.

What to do: Correct the parameters for this operation and channel before requesting again. Repeating an unchanged invalid request will not resolve the error.

Illustrative JSON; message varies with the actual cause · 400 · 10000
{
  "request_id": "req_example",
  "error": {
    "code": "invalid_request",
    "numeric_code": "10000",
    "message": "Invalid request parameters"
  }
}
invalid_target_workspace · 11003 · 400

The workspace override target is empty or malformed. Remove the override header and use the API key belonging to the intended workspace.

When it occurs: Applies when the request includes the X-Workspace-Id workspace override header.

What to do: Correct the parameters for this operation and channel before requesting again. Repeating an unchanged invalid request will not resolve the error.

Illustrative JSON; message varies with the actual cause · 400 · 11003
{
  "request_id": "req_example",
  "error": {
    "code": "invalid_target_workspace",
    "numeric_code": "11003",
    "message": "Invalid target workspace"
  }
}
invalid_api_key · 11001 · 401

Check whether the API key is correct and enabled.

What to do: Keep request_id and the structured codes, and investigate the current operation before taking another action.

Illustrative JSON; message varies with the actual cause · 401 · 11001
{
  "request_id": "req_example",
  "error": {
    "code": "invalid_api_key",
    "numeric_code": "11001",
    "message": "Invalid API key"
  }
}
missing_api_key · 11000 · 401

Add the X-Api-Key header.

What to do: Keep request_id and the structured codes, and investigate the current operation before taking another action.

Example · 401 · 11000
{
  "request_id": "req_xxx",
  "error": {
    "code": "missing_api_key",
    "numeric_code": "11000",
    "message": "Missing X-Api-Key header"
  }
}
workspace_override_forbidden · 11002 · 403

The request attempts a workspace override that this API key is not allowed to use. Remove the override header and use the API key belonging to the intended workspace.

When it occurs: Applies when the request includes the X-Workspace-Id workspace override header.

What to do: Keep request_id and the structured codes, and investigate the current operation before taking another action.

Illustrative JSON; message varies with the actual cause · 403 · 11002
{
  "request_id": "req_example",
  "error": {
    "code": "workspace_override_forbidden",
    "numeric_code": "11002",
    "message": "Workspace override is not allowed"
  }
}
target_workspace_not_found · 11004 · 404

The overridden workspace was not found or is unavailable. Verify workspace ownership, remove the override header and use the intended workspace’s API key; repeated requests do not grant access.

When it occurs: Applies when the request includes the X-Workspace-Id workspace override header.

What to do: Check the target identifier, resource ownership and current workspace. Do not treat a confirmed missing or inaccessible target as a temporary service failure to retry automatically.

Illustrative JSON; message varies with the actual cause · 404 · 11004
{
  "request_id": "req_example",
  "error": {
    "code": "target_workspace_not_found",
    "numeric_code": "11004",
    "message": "Target workspace not found"
  }
}
list_accounts_failed · 20000 · 500

List accounts: the service could not produce a valid query result.

What to do: Keep request_id and check the requested identifiers and account access. Retry this read only after checking the cause; a failed query does not prove an empty or missing resource.

Illustrative JSON; message varies with the actual cause · 500 · 20000
{
  "request_id": "req_example",
  "error": {
    "code": "list_accounts_failed",
    "numeric_code": "20000",
    "message": "Failed to list accounts"
  }
}