Skip to main content

Submit the Meta Authorization Result

POST/v1/onboarding/invitations/{token}/complete

[Customer-side, unauthenticated] Submit the Meta authorization result and trigger the onboarding orchestration. The account and Portfolio come only from the invitation record and cannot be overridden by the body; extra fields are rejected. A 202 does not mean onboarding succeeded — you must read status.

Authentication

This endpoint does not require an API Key.

Request​

Base URL: https://api.bluehola.com

Parameters​

NameInRequiredType / constraintsDescription
tokenpathYesstringThe one-time token from the invitation link

Request body​

A request body is required.

Request body fields​

FieldTypeRequiredDescription
codestringYesA one-time Meta OAuth authorization code
wabaIdstringYesThe WABA ID returned by Meta (numeric)
phoneNumberIdstringNoThe Phone Number ID returned by Meta (numeric). May be absent — as of ES v3 a customer can onboard just the WABA
esVersionv2 | v3 | v4NoThe ES version this run used
sessionInfoobjectNoThe raw ES session info

Content-Type: application/json Example:

{
"code": "<META_OAUTH_CODE>",
"wabaId": "<META_WABA_ID>",
"phoneNumberId": "<META_PHONE_NUMBER_ID>"
}

Schema:

{
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "string · required — a one-time Meta OAuth authorization code"
},
"wabaId": {
"type": "string",
"description": "string · required — the WABA ID returned by Meta (numeric)"
},
"phoneNumberId": {
"type": "string",
"description": "string · optional — the Phone Number ID returned by Meta (numeric). May be absent — as of ES v3 a customer can onboard just the WABA"
},
"esVersion": {
"type": "string",
"description": "v2 | v3 | v4 · optional — the ES version this run used"
},
"sessionInfo": {
"type": "string",
"description": "object · optional — the raw ES session info"
}
},
"required": [
"code",
"wabaId"
],
"example": {
"code": "<META_OAUTH_CODE>",
"wabaId": "<META_WABA_ID>",
"phoneNumberId": "<META_PHONE_NUMBER_ID>"
}
}

Response​

StatusDescription
202Accepted
4xxClient error

For the common error envelope and how to handle it, see Error Codes.

Notes​

Concurrency safety​

The claim runs a single atomic WHERE status='pending' AND expires_at>now() conditional update first, and the orchestration only starts once that succeeds — so even if the customer's finger slips and they double-click submit on the landing page, Meta-side subscriptions and assets cannot be created twice concurrently. If the orchestration throws before an operation record is actually created (for example the target Portfolio was deleted by the platform after the link was generated), the invitation is automatically put back to pending so the customer can resubmit, rather than being permanently stuck in "processing".

The response is a redacted projection​

It contains only status/currentStep/steps/requiredInput/error, and never returns the operation id itself. requiredInput in particular lets the landing page immediately tell which category a failure falls into:

  • the customer needs to go through Meta authorization again (retry with a fresh code)
  • the client side cannot fix it and needs to contact an account manager

There is no need to wait for the next /status poll before updating the message shown.