How to get your customers' API tokens for WhatsApp, Instagram and TikTok
easyCoexistence's Partner API returns a connected customer's API token and IDs with one GET and ?credentials=1. For a WhatsApp number, /connections/{id} gives waba_id, phone_number_id, the Graph API base, the send endpoint and the customer's own business token. For a social account, /channels/{id} gives the network's API base, the account's ID there and an access token renewed for you, so fetch it at the start of each job.
Adds credentials to GET /connections/{id} for a WhatsApp number and to GET /channels/{id} for a social account.
Lifetime of a Google user access token, the kind a YouTube channel's API calls carry.
Validity of a TikTok account access token from the API for Business; its refresh token is valid for one year.
How long a refreshed long-lived Instagram token stays valid, counted from the day it was refreshed.
Meta's long-lived Page access tokens have no expiration date, though certain conditions can invalidate them.
Which call returns a connection's credentials?
The resource's own GET with ?credentials=1, authenticated with your ec_live_ key as a bearer token. A WhatsApp number lives at /connections/{id} and a social account at /channels/{id}, each with its own ID namespace: the connect redirect hands you connection_id for a number and channel_id for a social account. GET /connections and GET /channels list them, and ?external_ref= narrows either list to one customer. Without the parameter, the same calls return the connection with no token in it.
# A WhatsApp number
curl "https://easycoexistence.com/api/v1/connections/$CONNECTION_ID?credentials=1" \
-H "Authorization: Bearer $EC_API_KEY"
# A social account
curl "https://easycoexistence.com/api/v1/channels/$CHANNEL_ID?credentials=1" \
-H "Authorization: Bearer $EC_API_KEY"What does a WhatsApp number's credentials call return?
The connection itself plus a credentials object. waba_id and phone_number_id identify the WhatsApp Business Account and the number on Meta's Graph API, and token_ready says whether a customer token is on file. Inside credentials, graph_api_base and send_endpoint already carry the Graph API version, and access_token is the business token Meta issued when the customer connected, scoped to that customer. Your backend then calls Meta directly to send, manage templates, upload media and edit the business profile.
- status: connected, degraded, disconnected, banned, suspended, removed or unknown.
quality_ratingandmessaging_tier: Meta's rating, such as GREEN, and the number's tier, such asTIER_1K.webhook_url: where Meta sends the number's messages, or null.disconnected_reason,last_checked_at,last_event_atandcreated_at: Meta's disconnection reason when one is on record, and ISO 8601 timestamps.
{
"id": "<CONNECTION_ID>",
"external_ref": "customer_4821",
"connect_session_id": "cs_…",
"phone": "+55 11 9…",
"name": "Clínica Sorriso",
"waba_id": "<WABA_ID>",
"phone_number_id": "<PHONE_NUMBER_ID>",
"status": "connected",
"quality_rating": "GREEN",
"messaging_tier": "TIER_1K",
"platform_type": "…",
"token_ready": true,
"webhook_url": "https://hooks.example.com/wa/<long-random-secret>",
"disconnected_reason": null,
"last_checked_at": "2026-10-31T09:00:00.000Z",
"last_event_at": "2026-10-31T08:41:12.000Z",
"created_at": "2026-10-20T14:03:55.000Z",
"credentials": {
"graph_api_base": "https://graph.facebook.com/v25.0",
"send_endpoint": "https://graph.facebook.com/v25.0/<PHONE_NUMBER_ID>/messages",
"access_token": "EAAG…",
"note": "The customer's own business token, scoped to their assets. …"
}
}What does each social network's credentials call return?
The channel's view, the same as GET /channels/{id}, with id, channel, external_ref, name, username, external_id, status and token_ready, plus a credentials object. Every network's credentials hold platform, an API base, the account's ID on that network, access_token, token_expires_at, a token_note and example calls. The ID field, and anything else a network needs, differ:
Why fetch a social token per job instead of storing it?
Because some rotate within a day, and the credentials call always answers with a token that is valid at that moment. YouTube's Google token lasts an hour and TikTok's a day, and easyCoexistence renews both before they run out. Instagram's lasts 60 days and is refreshed well before that, which issues a new token. A Facebook Page token does not expire while the Page stays connected. One request at the start of each job keeps your code from ever calling a network with a token that has lapsed.
Should you store a WhatsApp number's token?
Yes. It is the business token from Meta's Embedded Signup, which Meta scopes to that onboarded customer, and the reference asks you to store it on your side, since the dashboard does not show it. Read it again after each connection.connected event, because a reconnection can issue a new one. A suspended or removed number's token is no longer served, and a customer token that Meta stops accepting while the number still answers is retired, which turns token_ready false.
What do token_ready and token_missing mean?
token_ready is true when a customer token is on file and the connection is live. On a number it can be false right after connecting, because Meta sometimes finishes Embedded Signup without issuing the customer's token. The hosted page then asks the customer for one more run, and your events endpoint receives connection.token_missing. If they skip it, the number receives messages, since its IDs are valid, but cannot send. A new connect session for that customer issues the token and never replaces one that already works. Social channels have no token_missing: their sign-in always yields the customer's own token, so token_ready follows status.
What comes back when a connection has no token to give?
A 200 whose credentials hold access_token null and a note saying what to do, rather than an error. That covers a number with token_ready false, a suspended or removed number, and a channel whose status is not connected, where the note asks for a new connect session. A 404 not_found means the ID is not on your account, and a 502 credentials_unavailable means a fresh social token could not be obtained at that moment; retry, and check the channel's status if it repeats.
Common mistakes
- Caching a YouTube or TikTok token in a config file. They expire within an hour and a day, so call the credentials endpoint at the start of every job and leave renewal to easyCoexistence.
- Sending from a number whose token_ready is false. There is no customer token to call Meta with; open a new connect session for that customer, which issues one.
- Calling TikTok with an Authorization header. Its Business API takes the token in an Access-Token header, with the account's business_id in every request.
- Calling LinkedIn with the bearer token alone. LinkedIn also wants the LinkedIn-Version and X-Restli-Protocol-Version headers listed in required_headers, and URNs in paths URL-encoded.
easyCoexistence connects your customers' WhatsApp numbers and their Instagram, Facebook, TikTok, YouTube and LinkedIn accounts, and more channels, then hands your backend each connection's credentials on request, with social tokens renewed and every connection monitored 24/7. US$ 9 to US$ 0.75 per connection per month, falling as you add connections, with the first 3 days free.
easyCoexistence is a multichannel API and MCP server that connects AI agents such as Claude and ChatGPT to WhatsApp, Instagram, TikTok, Facebook and more. On WhatsApp it uses Coexistence: the business keeps using its number in the WhatsApp Business app while the AI works through Meta's official API.
Frequently asked questions
Is the WhatsApp token the customer's own?
Yes. It is the business token Meta issues when the customer connects through Embedded Signup, scoped to that customer. easyCoexistence's system token is never exposed, and the call returns a token only when token_ready is true.
How long do social access tokens last?
YouTube's lasts an hour, TikTok's a day and Instagram's up to 60 days, while a Facebook Page token does not expire. easyCoexistence renews the ones that rotate, so each credentials call returns a token that works now.
Do I need my own developer app on each network?
No. Customers sign in through easyCoexistence's own app on Meta, TikTok, Google and LinkedIn, and the credentials call hands your backend the token for calling that network's API directly.
Can an assistant such as Claude or ChatGPT read the same credentials?
Yes. Signed in to your account through the MCP server, it can call get_api_credentials for a number and get_social_credentials for a social account, which returns the same credentials as the Partner API.
Keep reading
Connect your first channel in two minutes.
No platform reviews to wait for. Connect WhatsApp, Instagram, TikTok or another channel, then ask your AI to post, reply or report, and watch it work.
- 3 days free
- Cancel any time
- Official APIs only
- Monitored 24/7
Verified on