Skip to main content
The v2 API accepts two kinds of Bearer credentials:
  • API keys (sk_live_…) for server-to-server integrations. A key belongs to one team and carries explicit scopes.
  • OAuth access tokens issued to a signed-in PickFu user. Use these when your app acts on behalf of individual PickFu users, as the MCP server and PickFu OAuth apps do.
Both go in the Authorization header:

Minting a key

Create a v2 API key in Settings → API keys. A key belongs to exactly one team and is the unit of authorization — every resource the key can see or change belongs to that team. The create form has a scopes picker with all three scopes checked by default. Uncheck any scope the key doesn’t need; leave them all checked to mint an all-scopes key. Each existing key’s scopes are shown on the list; keys with no scopes are flagged as not working with v2 and need to be re-issued.

Scopes

Every v2 key carries an explicit subset of three scopes. A key with no scopes is rejected on every v2 route with 403 api_key_unscoped. Re-issue the key in Settings to fix it — pick the scopes you want, or leave all three checked. Publishing a survey needs spend; a write-only key can draft and edit surveys but cannot spend money on them. A read-only key can watch progress and download results.

Older unscoped keys

Keys minted before the scope picker landed had no scopes attached, so they now fail every v2 call with 403 api_key_unscoped. Those keys keep working on v1. To use v2, mint a new key with the scopes you need — the create form now defaults to all three scopes, so a key minted without touching the picker will accept every v2 call the caller is otherwise entitled to.

OAuth access tokens

PickFu verifies every OAuth access token’s issuer, signature, expiry, and audience before accepting it. Tokens addressed to the PickFu MCP server’s resource URL are accepted too, so an MCP client’s OAuth token works on /v2 directly.

Scopes for OAuth tokens

OAuth tokens use the same read, write, and spend scopes as API keys:
  • If your app requests read, write, or spend explicitly, PickFu grants exactly those scopes. A read-only token can list and read resources but gets 403 insufficient_scope on any write or spend call.
  • If your app registers through Dynamic Client Registration and requests only OIDC scopes (openid email profile offline_access) or no scopes, PickFu grants all three scopes for compatibility.
  • If your app requests unrecognized scopes, alone or mixed with OIDC scopes, the token gets no PickFu scopes. Every v2 call then fails with 403 insufficient_scope.
A user with the viewer role on the selected team can read with an OAuth token but can’t write or spend. Those calls fail with 403 team_role_required.

Choosing the owner

An API key always acts for the team it was minted in. An OAuth token can act for any team the user is an active member of, or for the user’s personal account. Pick the owner per request with X-PickFu-Team:
Send X-PickFu-Team: personal to act for the user’s personal account. Without the header, PickFu uses the user’s newest active team membership, or the personal account if the user has no teams. A team the user doesn’t belong to fails the request instead of falling back to another owner.

Endpoints that require an API key

POST /v2/surveys/{id}/add-respondents and partner integration endpoints accept API keys only. Calling them with an OAuth token returns 401 invalid_api_key.

Identifying the team with an API key (optional)

The team is the key. You can optionally assert which team you think you’re calling by sending:
If the header is present and doesn’t match the key’s team, the request fails 403 team_mismatch. Use this as a defensive check in multi-tenant integrations where a key is loaded by ID and you want to guarantee the caller and the key agree on the team.

Who’s calling? GET /v2/me

GET /v2/me returns the calling credential, its scopes, the owner it acts for, and the user behind it. For an API key, user is the user who minted it (when known). For an OAuth token, user is the signed-in user, authentication.type is oauth, and apiKey is null.
livemode is true for sk_live_… keys.