List connected WhatsApp accounts
package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://api.kirimdev.com/v1/accounts?status=connected&customer_id=cus_01HXYZABCDEFGHJKMNPQRSTVWX"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}const url = 'https://api.kirimdev.com/v1/accounts?status=connected&customer_id=cus_01HXYZABCDEFGHJKMNPQRSTVWX';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}use reqwest;
#[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/accounts";
let querystring = [ ("status", "connected"), ("customer_id", "cus_01HXYZABCDEFGHJKMNPQRSTVWX"), ];
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer <token>".parse().unwrap());
let client = reqwest::Client::new(); let response = client.get(url) .query(&querystring) .headers(headers) .send() .await;
let results = response.unwrap() .json::<serde_json::Value>() .await .unwrap();
dbg!(results);}curl --request GET \ --url 'https://api.kirimdev.com/v1/accounts?status=connected&customer_id=cus_01HXYZABCDEFGHJKMNPQRSTVWX' \ --header 'Authorization: Bearer <token>'List the WhatsApp accounts attached to the calling organization. The returned business_phone_number_id is the value to use in /{phone_number_id}/... path-based endpoints (Meta-style — sender comes from the URL, not the body). Defaults to status=connected because that’s the only state in which sends are accepted; pass status=all to inspect onboarding-in-progress or disconnected accounts. Response is intentionally not paginated.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters ”Account lifecycle filter. Omit for connected accounts; use all to include onboarding and disconnected accounts.
Example
connectedAccount lifecycle filter. Omit for connected accounts; use all to include onboarding and disconnected accounts.
Return accounts owned by this end-customer. Unknown or cross-organization IDs produce an empty list.
Example
cus_01HXYZABCDEFGHJKMNPQRSTVWXReturn accounts owned by this end-customer. Unknown or cross-organization IDs produce an empty list.
Responses
Section titled “ Responses ”Account list
object
Items in this page, ordered as documented by the operation.
object
Meta WhatsApp Business phone_number_id. Use as the {phone_number_id} path parameter in /v1/{phone_number_id}/... endpoints. Nullable while onboarding is in flight.
Lifecycle state of the account (e.g. connected, disconnected, degraded, onboarding).
Meta’s own phone-number status (CONNECTED, PENDING, UNVERIFIED, DISCONNECTED, …), or null if never fetched. Distinct from status: a value other than CONNECTED — or a status other than connected — means the number likely needs registration via POST /v1/{phone_number_id}/register.
Public id of the end-customer (multi-tenant platform mode) that owns this account. NULL for direct-org accounts. Filter the list endpoint via ?customer_id=cus_....
Whether another page is available.
Pass this value unchanged as cursor to fetch the next page. null marks the final page.
Unique request identifier to include when contacting support.
Example
{ "data": [ { "object": "account", "phone_number_id": "106540352242922", "phone_number": "+628111222333", "name": "Customer Support", "status": "connected", "meta_status": "CONNECTED", "customer_id": "cus_01HXYZABCDEFGHJKMNPQRSTVWX" } ], "has_more": false, "next_cursor": null, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"}Validation failure
object
object
Human-readable explanation of the error.
Request field associated with the error, when applicable.
Unique request identifier to include when contacting support.
Examples
A field value is invalid.
{ "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }}Authentication failure
object
object
Human-readable explanation of the error.
Request field associated with the error, when applicable.
Unique request identifier to include when contacting support.
Examples
The provided API key is invalid.
{ "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }}Rate limit exceeded
object
object
Human-readable explanation of the error.
Request field associated with the error, when applicable.
Unique request identifier to include when contacting support.
Examples
Rate limit exceeded.
{ "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }}Internal server error
object
object
Human-readable explanation of the error.
Request field associated with the error, when applicable.
Unique request identifier to include when contacting support.
Examples
An unexpected error occurred.
{ "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }}