Start code authentication
Starts a verification-code login flow. After this call, submit the provider code through /auth/code. If two-factor auth is required, continue with /auth/password. WhatsApp uses this same endpoint for phone-number pairing — the phone number is read from the account (saved at creation through provider_data.phone) and does not need to be supplied here.
https://api.unifyport.ai/v1/accounts/{account_id}/auth/startHeaders
X-Api-KeyWorkspace API key. The workspace is resolved from this header.
Content-TypeUse application/json when sending a JSON request body.
Path parameters
account_idIdentifier used in the authentication route.
Request body
This endpoint does not require a JSON request body.
Response body
account_idProvider account this response refers to.
statusCurrent authentication flow state, such as awaiting_code, awaiting_qr_scan, authorized, or cancelled.
auth_fieldsDescribes what the next step requires — each entry carries a type and whether it is required.
auth_payloadMaterial the client needs to render the next step, such as qr_code or verify_code.
expires_atRFC3339 timestamp after which the current auth_payload is no longer valid.
Responses
200Request succeeded. See the example response body.
400The request body, path, or parameters are invalid.
401The X-Api-Key header is missing or invalid.
409The requested operation conflicts with an existing provider account or resource.
500The service encountered an unexpected error.
Request
curl -X POST https://api.unifyport.ai/v1/accounts/{account_id}/auth/start \
-H "X-Api-Key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{}'Response
{
"data": {
"account_id": "acc_example",
"status": "awaiting_code",
"auth_fields": [
{ "type": "code", "required": true }
],
"auth_payload": {
"verify_code": "ABCD-EFGH"
},
"expires_at": "2026-01-01T00:00:00Z"
}
}