Manage your client secrets
Your app's client secret comes from the one-time link we email when you create your app (see OAuth2 App credentials). The same link gives you a registration access token. With it, you rotate and revoke your client secrets yourself, through the API below.
| Client secret | Registration access token | |
|---|---|---|
| What it's for | Getting and refreshing access tokens | Creating, listing and revoking your client secrets |
| Where you send it | https://{subdomain}.gorgias.com/oauth/token | https://webhooks.gorgias.com/idp/oauth/register/{client_id} |
| How long it works | Until you rotate or revoke it. Several can work at the same time | One call: each call returns the next token |
Always store the new registration access token
The registration access token works for one call. Every successful call returns a registration_access_token in its response, and the token you sent stops working. This includes GET calls.
- Store the new token before you do anything else with the response. If you lose it, you can't call the API until we send you a new link.
- Make one call at a time. If two calls use the same token, only the first one goes through. The second one gets
401 invalid_token. - A refused call doesn't use the token up. After a
404,409or429, call again with the same token. - If you get no response (a timeout or a network error), you can't tell whether the call went through. Call again with the same token. If it's refused with
401 invalid_token, the first call went through and its token is lost: contact us.
Keep the registration access token on your serversStore it in your secrets manager, like the client secret. Anyone who has it can create and revoke your client secrets.
Rotate your client secret
Rotate it on a schedule, or right away if you think it leaked.
curl -X POST "https://webhooks.gorgias.com/idp/oauth/register/<client_id>/secrets" \
-H "Authorization: Bearer <registration_access_token>"Response (201 Created):
{
"client_id": "<client_id>",
"client_secret": "<new client secret, shown once>",
"client_secret_id": 42,
"client_secrets": [
{"id": 42, "created_at": "2026-12-01T10:00:00+00:00", "expires_at": null},
{"id": 17, "created_at": "2026-11-20T09:12:00+00:00", "expires_at": "2026-12-08T10:00:00+00:00"}
],
"registration_access_token": "<next registration access token>"
}- Store
client_secretandregistration_access_tokenright away: neither can be shown again. - Deploy the new client secret. Your other client secrets keep working for 7 days (their
expires_at), so your app keeps working while you roll it out. - Once the new secret is live everywhere, revoke the old one, or let it expire.
You can create at most 5 client secrets in 24 hours. Beyond that, the call is refused with 429 and a Retry-After header, in seconds.
List your client secrets
curl "https://webhooks.gorgias.com/idp/oauth/register/<client_id>" \
-H "Authorization: Bearer <registration_access_token>"Response (200 OK): the same fields as above, without client_secret and client_secret_id. It shows the id and dates of each client secret that still works, never its value. Store the new registration_access_token.
Revoke a client secret
To stop a client secret from working right away, before its 7 days are over:
curl -X DELETE "https://webhooks.gorgias.com/idp/oauth/register/<client_id>/secrets/<client_secret_id>" \
-H "Authorization: Bearer <registration_access_token>"Response (200 OK): the client secrets that still work, and the next registration_access_token.
You can't revoke your only client secret that doesn't expire (409 last_active_secret): your app would be left without one. Rotate first, then revoke the old one.
Errors
Errors look like this:
{"error": "last_active_secret", "error_description": "The client would be left without a secret that doesn't expire: rotate it first."}| Status | error | What it means |
|---|---|---|
401 | invalid_token | The registration access token is missing, wrong, already used or revoked |
404 | not_found | Your app has no working client secret with this ID |
409 | last_active_secret | You tried to revoke your only client secret that doesn't expire. Rotate first |
429 | too_many_secrets | Over 5 new client secrets in 24 hours. Try again after Retry-After seconds |
Only 401 means the token can't be used. After any other error, your token still works.
Emails about your credentials
We email every developer account of your app each time its credentials change, with the subject "Gorgias: The credentials of your app {app name} changed". That covers a client secret created or revoked, the credentials revealed with a link, and a registration access token revoked. The email says what changed and who changed it: your team through the API, someone with the link, or Gorgias.
If nobody on your team made the change, contact us.
When to contact us
Write to [email protected] with your app's name and Client ID if:
- your link expired before anyone used it, or never arrived;
- you lost your registration access token, or never got the response of a call;
- someone outside your team used your link, or you got an email about a change nobody on your team made;
- the developers of your app changed. Update the developer accounts in the Developer Portal first: a new link goes to them.
We send a new link to your app's developer accounts. It gives you a new registration access token, which replaces the current one, and a new client secret only if your app has none. With the token, you then create a new client secret yourself.
If you only lost your client secret and still have your registration access token, you don't need us: rotate it.
Didn't get the link for a new app?The link only goes to the developer accounts of your app in the Developer Portal: check that they use addresses you can read. We also limit how many new apps of an organization get a link each day (UTC), and how many developer accounts each link goes to. An app over the daily limit gets its link the next day. If you need it sooner, contact us.
Updated 4 days ago