# Authentication and OAuth 2.0

**URL:** https://furcata.com/en/docs/authentication  
**Type:** doc

Every request to the Furcata API is authenticated. Use an API key for server-to-server calls, or an OAuth 2.0 access token when you are acting on behalf of a Furcata user or an AI agent.

### Two ways to authenticate

- API key: send it in the Authorization header as a bearer token, Authorization: Bearer YOUR_API_KEY. Best for your own backend.
- OAuth 2.0 access token: send Authorization: Bearer YOUR_ACCESS_TOKEN. Best for apps and agents that act for a user.

Every endpoint lives under the base URL https://api.furcata.com/v0.

### How users sign in

Furcata sends a user a sign-in link by email. On a phone, opening the link hands it to the Furcata app, which finishes the sign-in there.

A user can also link Google or Apple to their sign-in.

### Register your client

OAuth clients are registered dynamically, following RFC 7591. Send your redirect URIs and Furcata returns a client_id you can use in the rest of the flow.

- redirect_uris (required): the addresses Furcata may send the user back to.
- client_name: a human-readable name for your integration, up to 256 characters.
- grant_types: authorization_code and refresh_token.
- response_types: code.
- token_endpoint_auth_method: none for public clients.
- scope: the scopes you are asking for, up to 512 characters.

### Authorization code flow

The flow has three steps. The authorization code is single use, so exchange it immediately.

- Send the user to the consent page with your client_id and redirect_uri.
- After the user signs in, exchange the signed-in user's Furcata token for an authorization code.
- Exchange the authorization code for an access token and a refresh token.

### Refresh an access token

Access tokens are short lived. When one expires, exchange your refresh token for a new pair instead of asking the user to sign in again.

### Check the current session

Use the session endpoint to confirm that a token is still valid and to see who it belongs to.

### Discovery documents

Clients and agents can discover how to authenticate without any configuration. These documents are public.

- https://api.furcata.com/v0/.well-known/oauth-authorization-server
- https://api.furcata.com/v0/.well-known/oauth-protected-resource
- https://api.furcata.com/v0/.well-known/oauth-protected-resource/mcp

## Note

##### Use PKCE

Send a code_challenge with code_challenge_method set to S256 when you start the flow, then send the matching code_verifier when you exchange the code. It protects the authorization code if it is ever intercepted.

### Next steps

Read Errors and idempotency to learn how failures are reported, then Rate limits to see how much you can send. The REST API overview lists every endpoint.
