- Developers
- Get started
Authentication
The REST API uses workspace API keys. The MCP connector uses OAuth 2.1, so each person signs in as themselves and nobody pastes a key into an assistant.
#API keys
Create keys in the RevFirst app under Integrations → API & webhooks. A key belongs to one workspace and sees only that workspace’s data. Send it as a Bearer token on every request:
GET /api/v1/people HTTP/1.1
Host: app.revfirst.co
Authorization: Bearer rf_live_…| Property | Value |
|---|---|
| Format | rf_live_ followed by a random string |
| Scope | One workspace. Full read access, plus adding people to campaigns |
| Shown | Once, when you create it. Afterwards the app shows only its first characters |
| Stored | As a SHA-256 hash. RevFirst can’t show you a lost key; create a new one |
| Expiry | None. Revoke it when you no longer need it |
| Last used | Shown next to each key in the app, so you can spot unused keys |
A missing, wrong or revoked key gets 401 unauthorized.
#Keeping keys safe
- Keep keys on your servers, in environment variables or a secrets manager. Never ship one in a browser app, a mobile app or a public repository.
- Use one key per system (“CRM sync”, “Data warehouse”), so you can revoke one without breaking the others.
- If a key may have leaked, revoke it in the app at once and create a new one. Revoking takes effect on the next request.
#OAuth for the connector
ChatGPT, Claude and other MCP clients sign in to RevFirst with OAuth 2.1: they register themselves automatically, send the person to a RevFirst consent page, and get a short-lived token. You don’t configure any of this by hand. Adding the address https://app.revfirst.co/api/mcp to your assistant is enough; see MCP connector.
What happens, step by step:
- The assistant calls the connector without a token and gets
401with aWWW-Authenticateheader pointing at RevFirst’s protected-resource metadata. - It reads the metadata, registers itself as a public client (dynamic client registration, no client secret) and starts the authorization-code flow with PKCE (S256).
- The person signs in to RevFirst and sees exactly what the assistant will be able to do, in their workspace. They press Allow or Cancel.
- The assistant swaps the one-time code for an access token and a refresh token, then calls the connector with
Authorization: Bearer rf_mcp_….
#OAuth endpoints
For building your own MCP client. Standard assistants discover all of this on their own.
| What | Address | Standard |
|---|---|---|
| Protected-resource metadata | https://app.revfirst.co/.well-known/oauth-protected-resource | RFC 9728 |
| Authorization-server metadata | https://app.revfirst.co/.well-known/oauth-authorization-server | RFC 8414 |
| Client registration | POST https://app.revfirst.co/api/oauth/register | RFC 7591 |
| Authorization (consent page) | https://app.revfirst.co/oauth/authorize | OAuth 2.1 |
| Token | POST https://app.revfirst.co/api/oauth/token | OAuth 2.1 |
The authorization-server metadata, as served:
{
"issuer": "https://app.revfirst.co",
"authorization_endpoint": "https://app.revfirst.co/oauth/authorize",
"token_endpoint": "https://app.revfirst.co/api/oauth/token",
"registration_endpoint": "https://app.revfirst.co/api/oauth/register",
"scopes_supported": [
"plays"
],
"response_types_supported": [
"code"
],
"grant_types_supported": [
"authorization_code",
"refresh_token"
],
"token_endpoint_auth_methods_supported": [
"none"
],
"code_challenge_methods_supported": [
"S256"
]
}Registering a client:
curl -X POST "https://app.revfirst.co/api/oauth/register" \
-H "Content-Type: application/json" \
-d '{ "client_name": "My assistant", "redirect_uris": ["https://example.com/oauth/callback"] }'- Redirect addresses must be
https, orhttponlocalhost/127.0.0.1only. Up to 10 per client. - PKCE with
S256is required; the verifier is 43 to 128 characters. - The token endpoint accepts form-encoded or JSON bodies, with
grant_typeauthorization_codeorrefresh_token.
#Tokens and lifetimes
| Token | Looks like | Lasts |
|---|---|---|
| Authorization code | rfa_… | 5 minutes, works once, tied to the client, redirect address and PKCE challenge |
| Access token | rf_mcp_… | 1 hour |
| Refresh token | rf_mcr_… | 30 days. Rotates: each refresh returns a new pair and retires the old one |
| Consent page | — | 10 minutes, tied to the person who opened it |
RevFirst stores only hashes of codes and tokens. Scope is always plays: the connector’s tools, nothing else.
#Revoking access
- API keys: Integrations → API & webhooks → revoke.
- Assistants: Integrations → Use RevFirst from Claude → Disconnect next to the assistant. Its tokens stop working on the next call.
- People: removing someone from the workspace cuts off their connector sign-ins too.
The REST API base address is https://app.revfirst.co/api/v1.
Last updated 25 November 2026 · Questions? Write to satvik@revfirst.co