DevelopersAuthentication
  1. Developers
  2. 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:

HTTP
GET /api/v1/people HTTP/1.1
Host: app.revfirst.co
Authorization: Bearer rf_live_…
PropertyValue
Formatrf_live_ followed by a random string
ScopeOne workspace. Full read access, plus adding people to campaigns
ShownOnce, when you create it. Afterwards the app shows only its first characters
StoredAs a SHA-256 hash. RevFirst can’t show you a lost key; create a new one
ExpiryNone. Revoke it when you no longer need it
Last usedShown 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:

  1. The assistant calls the connector without a token and gets 401 with a WWW-Authenticate header pointing at RevFirst’s protected-resource metadata.
  2. 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).
  3. 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.
  4. 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.

WhatAddressStandard
Protected-resource metadatahttps://app.revfirst.co/.well-known/oauth-protected-resourceRFC 9728
Authorization-server metadatahttps://app.revfirst.co/.well-known/oauth-authorization-serverRFC 8414
Client registrationPOST https://app.revfirst.co/api/oauth/registerRFC 7591
Authorization (consent page)https://app.revfirst.co/oauth/authorizeOAuth 2.1
TokenPOST https://app.revfirst.co/api/oauth/tokenOAuth 2.1

The authorization-server metadata, as served:

JSON
{
  "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:

Shell
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, or http on localhost / 127.0.0.1 only. Up to 10 per client.
  • PKCE with S256 is required; the verifier is 43 to 128 characters.
  • The token endpoint accepts form-encoded or JSON bodies, with grant_type authorization_code or refresh_token.

#Tokens and lifetimes

TokenLooks likeLasts
Authorization coderfa_…5 minutes, works once, tied to the client, redirect address and PKCE challenge
Access tokenrf_mcp_…1 hour
Refresh tokenrf_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