Skip to content

API authentication, scopes and limits

Every call goes to https://api.click2reply.com/v1/… with JSON in and out and an Authorization: Bearer <token> header. The organization comes from the token, never from the path or the body. POST /v1/oauth/token, /v1/oauth/revoke and /v1/oauth/introspect are the exception: they follow RFC 6749, take form bodies too, and answer errors as { "error", "error_description" }.

TokenStarts withFor
Personal access tokenc2r_pat_Your own scripts, acting as you. Created in Settings > API and webhooks.
Bot tokenc2r_bot_A script that acts as a bot agent rather than a person.
OAuth access tokenc2r_oat_An app another organization installed; valid for 60 minutes.
OAuth refresh tokenc2r_ort_Trades for a new access token; valid for 60 days.

The quickstart walks through getting each. To see what a token can do, call GET /v1/oauth/info with it. To end one, revoke it in the settings, or for OAuth tokens call POST /v1/oauth/revoke.

A token holds the scopes it was granted that its agent’s role still allows, so a token never does more than the person or bot it acts as. Grant only what the code needs.

ScopeAllows
chats.accessRead and answer the chats of the groups the agent belongs to.
chats.allRead and answer every chat, in every group.
archives.readSearch and read archived chats.
archives.writeChange archived chats.
customers.readRead customer profiles.
customers.writeUpdate customer profiles.
customers.banBan customers.
traffic.readSee live website traffic.
campaigns.manageManage greetings, campaigns and goals.
canned.manageManage canned responses.
tags.manageManage tags.
reports.readRead reports.
team.readRead agents, bots, groups and their status.
team.manageInvite, change and suspend agents; manage groups.
settings.manageChange routing, widget and chat settings.
channels.manageConnect and change messaging channels.
ai.manageChange the AI model settings.
developers.manageManage webhooks, apps and bot tokens.
data.exportExport chats, customers and reports.

Billing, roles, your own tokens, OAuth app registration and the organization itself are changed only from a signed-in session, never with an API token.

Calls are never metered or charged. Limits only keep one client from starving the rest: 600 requests a minute per token, and 3000 per organization (120 on the free plan). Past a limit the API answers 429 with a retry-after header in seconds; every answer carries ratelimit-policy.

Every error has one shape, and the HTTP status follows from code:

{ "error": { "code": "validation", "message": "event.text: Too small", "details": {} } }
codeStatus
validation400
authentication401
authorization403
not_found404
conflict409
chat_inactive409
agent_unavailable409
entity_too_large413
idempotency_key_reused422
unsupported_version426
too_many_requests429
plan_limit402
internal500
not_implemented501
service_unavailable503

message is English for developers and may change; branch on code. Every answer carries an X-Request-Id header: quote it when you ask us about a call.

A list takes ?limit= (default 25, at most 100) and answers { "items": [...], "next_page_token": "..." }. Pass ?page_token= to read the next page; the token carries the first call’s filters, so send it alone. A null next_page_token is the last page.

Every write (POST, PUT, PATCH, DELETE) takes an Idempotency-Key header: your own unique value, such as a UUID, of 1 to 255 printable ASCII characters. Send the same request again with the same key, after a timeout for instance, and for 24 hours you get the first answer back, marked Idempotent-Replayed: true, instead of a second write.

  • The same key with a different body or on another route is refused with 422 idempotency_key_reused.
  • While the first request with a key is still running, a second one is answered 409 conflict with details.reason idempotency_in_flight: retry it a moment later.
  • Only a successful (2xx) answer is kept, so a request that failed runs again when you retry it.
  • An answer that hands out a credential (a token, a secret, recovery codes, a signed link) is never kept, so retrying one, such as POST /v1/tokens, runs it again.
  • A request without a token, such as signing in, and one with a body over 1 MB, such as an upload, ignore the key.
  • Keys are per credential: the same key sent with another token, session, agent or customer is a key of its own.

A chat event’s custom_id does the same for that event, with no time limit.

The API reference lists the routes with the scope each needs.