Every request to the API requires two authentication headers. These credentials identify your CometChat app and authorize access to its resources.

How do I authenticate?

Include the following headers on every API request:
HeaderDescription
appidYour CometChat App ID — uniquely identifies your CometChat app
apikeyYour CometChat API Key — authorizes the request
curl https://{appId}.api-{region}.cometchat.io/v3/business-messaging/api/channels \
  -H "appid: YOUR_APP_ID" \
  -H "apikey: YOUR_API_KEY"
Keep your apiKey secret. Do not expose it in client-side code or public repositories.

How does app scoping work?

All resources are scoped to a CometChat app. The appid header determines which app’s data you are accessing. Channels, templates, campaigns, and analytics are all isolated per app. This means:
  • Each CometChat App ID represents a separate app with its own isolated data
  • Resources created under one appid are invisible to other apps
  • You can manage multiple apps by switching the appid header
Both headers are required on every request. Omitting either one returns a 401 Unauthorized error.

Where do I find my credentials?

  1. Log in to the CometChat Dashboard
  2. Select your application
  3. Navigate to API & Auth Keys
  4. Copy your App ID and API Key

What errors can I expect?

Status CodeReason
401Missing or invalid appid or apikey
403Valid credentials but insufficient access