Skip to main content
Method supports two ways to authenticate requests: API keys and OAuth 2.0 client credentials. Both are sent as a Bearer token in the Authorization header of every request, and both resolve to the same team, so the rest of the API behaves identically. Use an API key to get started quickly, or where a single trusted service calls Method. Use OAuth when you want short-lived credentials that expire on their own, or when you want to restrict an integration to a subset of the API.

API keys

An API key identifies your team. Secret API keys have the prefix sk_, and your team has a separate key for each environment. Keys are available under the Keys section in the Method Dashboard, where you can also rotate them. API keys do not expire and carry full access to your team, so treat them as sensitive credentials: store them in a secrets manager, never in client-side code or version control. Get started by creating your account in the Method Dashboard or connect with our team.

OAuth

Method supports OAuth 2.0 Client Credentials as an alternative to API keys. You exchange a client_id and client_secret for a short-lived access token, then use that token on API requests in place of an API key.
  1. Create an OAuth client in the Method Dashboard to get a client_id and client_secret.
  2. Exchange them at POST /oauth/token for an access token, valid for 1 hour.
  3. Call the Method API with Authorization: Bearer <access_token>.
  4. When the token expires, request a new one the same way.

Credentials

Clients and secrets are managed under the OAuth section in the Method Dashboard, where you can mint new secrets and disable existing ones. Each environment has its own clients and secrets.
If you lose a client_secret, mint a new one from the Dashboard. Method cannot recover the original value.

Getting an access token

Send a POST request to /oauth/token with a application/x-www-form-urlencoded body containing grant_type=client_credentials. Authenticate with your client credentials using either HTTP Basic auth or the request body.
HTTP Basic auth is recommended, and is the default for most OAuth client libraries. Use the base URL for your environment.

Token endpoint errors

The token endpoint uses the standard OAuth error format rather than the Method error envelope.

Scopes

Scopes follow <resource>:<action>, where the action maps to the HTTP method: For example, entities:read allows GET /entities/… and entities:write allows POST /entities. Your client is granted a set of scopes by Method. By default a token carries all of them. To request a token with fewer scopes, pass a space-delimited scope parameter:
Requesting a scope your client has not been granted returns 400 invalid_scope.

Calling the API with an access token

Send the access token in the Authorization header. Everything else about the API is unchanged.
Two errors are specific to token-based requests:
  • 401 — the token is missing, invalid, expired, or revoked. Request a new token and retry.
  • 403 with sub_type: INSUFFICIENT_SCOPE — the token does not carry the scope this endpoint requires.

Token lifecycle

  • Cache the token and reuse it for its full lifetime. Do not request a new token per API call.
  • Renew shortly before expiry, for example 60 seconds early, to avoid a 401 at the boundary. On an unexpected 401, request a new token once and retry.
  • There are no refresh tokens. This is by design for the client credentials grant (RFC 6749 §4.4.3). Renewal is the same POST /oauth/token call again.
The token endpoint is rate limited.

Secret rotation

Rotate your client_secret from the Method Dashboard for routine rotation or suspected exposure. Your client_id never changes.
  1. Mint a new secret. Both the new and existing secrets remain valid.
  2. Deploy the new secret on your own schedule, with no downtime.
  3. Disable the old secret once you have confirmed cutover.
If a secret is compromised, disable it immediately.