Skip to main content

Authentication

All api.co.id APIs are authenticated with an API key sent in the x-api-co-id header.

Include this header in every request. Without it, the server returns 401.

Stored only in this browser and used by Try it.
Authenticated request
curl -X GET "https://use.api.co.id/regional/indonesia/provinces" \  -H "x-api-co-id: $API_CO_ID_KEY"
Chat API

Chat API uses its own API key, sent as Authorization: Bearer <key>. See Chat API › Getting Started.

Keeping your API key safe​

Authentication errors​

StatusMeaningHow to fix
401UnauthorizedMissing or invalid API key (e.g. User not authenticated).Send the x-api-co-id header with an active key.
402Payment RequiredInsufficient balance for a paid endpoint.Top up in the Dashboard, then retry.
Was this page helpful?