Authentication

The Flex API uses API keys to authenticate requests. An API key is the complete value in the format <prefix>.<secret>, including the period separating the two parts. The prefix always starts with fk_ and is available at all times. The secret is only visible when creating a new key. Each key has permissions that determine which resources it can access.

Create an API key

An organization administrator can create a key in Settings → API keys.

Give the key a recognizable name, choose its permissions, and select an expiration date. Copy the key when it appears and store it securely. The full key is shown only once.

Authenticate requests

Send your API key in the Authorization header:

Authorization: Bearer <YOUR_API_KEY>

Use the complete key, including its prefix and secret. Send requests over HTTPS and keep the key in a secure location.

Permissions

Permissions use the format resource:action. For example, accounts:read allows a key to read accounts, while cards:write allows it to create and update cards.

Grant only the permissions your integration needs. Reading a resource does not grant permission to change it, and sensitive actions can require additional permissions.

Protect and replace keys

Keep API keys out of browser code, mobile applications, source control, and logs.

Use IP restrictions to limit a key to requests from your integration's public outbound IP addresses.

Before a key expires, create a replacement and update your integration. Once the replacement is working, revoke the old key. If a key is exposed, revoke it immediately.

Authentication failures

A 401 Unauthorized response means the request could not be authenticated. Check that the header contains the complete key and that the key is active and has not expired. If the key has IP restrictions, also check that the request comes from an allowed address.

A 403 Forbidden response means the request lacks the required access. Check the key’s permissions for the organization and operation you are requesting.