- Machine-to-Machine (M2M) for your own backend services
- OAuth 2.1 for any integration that acts on behalf of a user: third-party apps, AI agents, dashboards
Machine-to-Machine (M2M) Authentication
M2M authentication is designed for backend services, internal automations, and server-to-server integrations. It uses access tokens that are scoped to your organization and expire automatically.How It Works
-
Request an Access Token
Exchange your
client_idandclient_secretfor an access token. Credentials can be supplied either in the request body or as HTTP Basic Auth:Or, equivalently, with Basic Auth:Response: -
Include the Token in API Requests
Add the access token to the
Authorizationheader: - Tokens Expire Access tokens are short-lived and expire after approximately 1 hour. Request a new one when the previous token is near expiry.
Example (cURL)
OAuth 2.1 Authentication
OAuth 2.1 is for integrations that act on behalf of a specific Profile user. That covers third-party apps, AI agents and MCP servers, CLI tools, and any browser-based dashboard where a user signs in. Tokens issued under OAuth are scoped to one Profile account (the one the user consented from) and carry OAuth scopes that narrow what the integration can do. The same bearer token works against the REST API (/api/v4/*) and the MCP endpoint (/mcp).
Discovery
Fetch the OAuth protected-resource metadata to learn where the authorization server lives and what scopes exist:WWW-Authenticate: Bearer resource_metadata="..." header pointing at this document, so clients can discover it automatically.
Client Registration
You have two ways to register an OAuth client:- Pre-registered integrations. For a production integration you build or operate (your own dashboard, an internal tool, a specific third-party connector), contact support to register a client and receive a
client_id(andclient_secretfor confidential clients). - Dynamic Client Registration (DCR). MCP agents and other on-the-fly clients can register themselves at the authorization server’s DCR endpoint. See the authorization server’s discovery document at
https://login.profilebehavior.com/.well-known/oauth-authorization-serverfor the registration URL. No pre-provisioning required.
How It Works
-
Redirect to authorize
Send the user’s browser to the authorization endpoint with the standard OAuth 2.1 query params (
client_id,redirect_uri,response_type=code,scope,state,code_challenge,code_challenge_method=S256): -
Consent
Profile shows the user a branded consent screen listing your app, the account they’re connecting, and the scopes requested. On approval, Profile redirects the browser back to your
redirect_uriwith an authorization code. -
Token exchange
Exchange the code for an access token at the token endpoint:
-
Make API requests
Include the token as a bearer in the
Authorizationheader:
Scopes
Scopes are the unit of authorization for OAuth tokens. A token can only perform operations covered by the scopes the user granted. Users see and can deny each scope on the consent screen, and can revoke an entire connection at any time from the Connected apps section of their user profile. Request only the scopes your integration actually needs. Over-asking on the consent screen is the single most common reason users deny a connection.profiles:read
Read access to profiles and their behavioral data.
Allows:
- Listing profiles on the connected account
- Reading a profile’s name, email, and phone
- Reading DISC, Focus, and Core assessment scores
- Reading AI-generated behavioral debriefs (and triggering generation of a debrief if one doesn’t exist yet)
profiles:write
Full profile lifecycle. Includes creating profiles via assessment invite.
Allows:
- Creating new profiles (sends a real assessment invite email or SMS)
- Updating profile metadata
- Deleting profiles
- Resending invite links
profiles:read alongside if you need both).
Typical use: HR tools, onboarding automations, roster-management integrations.
tags:manage
Full CRUD on tags and tag membership.
Allows:
- Listing, creating, renaming, recoloring, and deleting tags
- Replacing the set of profiles attached to a tag
account:read
Read access to account-level metadata.
Allows:
- Reading account name, logo, and preferences
- Reading the assessment catalog
- Reading resource aliases (external ID mappings)
profiles:read).
Typical use: diagnostic and reporting tools that need context about the account they’re connected to.
account:write
Modify account-level settings.
Allows:
- Updating account logo and preferences
- Creating, updating, and deleting resource aliases
Scope enforcement
Every API request is validated against the token’s granted scopes before the handler runs. An OAuth client calling an endpoint without the corresponding scope receives a 403 with a descriptive error message. There is no silent degradation or partial success.Example OAuth Request
Which Authentication Method Should I Use?
| Use Case | Auth Type |
|---|---|
| Your own backend services talking to our API | ✅ M2M |
| Cron jobs & internal automation | ✅ M2M |
| Third-party apps acting on a user’s behalf | ✅ OAuth |
| AI agents and MCP servers (ChatGPT, Claude) | ✅ OAuth |
| User-facing apps where a person signs in | ✅ OAuth |
Security Notes
- Never expose client secrets in frontend apps or browser-based code. Public clients (browser, mobile, CLI) must use PKCE instead.
- Access tokens are short-lived (~1 hour). Use refresh tokens to obtain new access tokens without re-prompting the user.
- OAuth users authenticate through Profile’s secure login. Passwords are never shared with external tools.
- Users can view and revoke any connected app from the Connected apps section of their user profile at any time.