Skip to content

Menu

  • Media
  • Pricing
  • Docs
  • Language: English

    This page isn’t available in the greyed-out languages.

    • English
    • Español
    • Português
    • Français
    • Deutsch
    • Italiano
    • Nederlands
    • Polski
    • 日本語
    • 한국어
    • Bahasa Indonesia
    • Tiếng Việt
    • Türkçe
    • العربية
    • ไทย
    • Български
    • Català
    • Hrvatski
    • Eesti
    • Magyar
    • Latviešu
    • Lietuvių
    • Srpski
    • Slovenčina
    • Slovenščina
    • Українська
    • Čeština
    • Română
    • Svenska
    • Dansk
    • Norsk bokmål
    • Suomi
    • עברית
    • हिन्दी
    • Tagalog
    • Bahasa Melayu
    • Ελληνικά
    • 简体中文
    • 繁體中文

Authentication

Every call except listing and reading operations needs an API key. Send it as a Bearer token in the Authorization header.

On this page

Send your key

Authorization: Bearer filesokay_…

For example, to get the credits your Workspace can spend:

curl https://api.filesokay.com/v1/credits \
  -H "Authorization: Bearer $FILESOKAY_KEY"
const res = await fetch("https://api.filesokay.com/v1/credits", {
  headers: {
    Authorization: `Bearer ${process.env.FILESOKAY_KEY}`,
  },
});
const balance = await res.json();
import os

import requests

res = requests.get(
    "https://api.filesokay.com/v1/credits",
    headers={
        "Authorization": f"Bearer {os.environ['FILESOKAY_KEY']}",
    },
)
balance = res.json()
Response
{
  "available_credits": 1908
}

Keys are read only from this header, never from the address, because addresses end up in logs.

Create a key

  1. In your Workspace, open Settings, then API keys.
  2. Select Create API key, and give the key a name you’ll recognise later.
  3. Confirm it’s you. The key is shown once: copy it and store it somewhere safe.

Admins and Members can both create keys, unless an Admin has turned off Members can create API keys. Each person can have up to 25 active keys in a Workspace. If you lose a key, revoke it and create a new one.

What a key can do

  • It acts in its own Workspace, which pays for the jobs it starts.
  • It sees the files and jobs made with any of its Workspace’s API keys, so a new key carries on where a replaced one stopped.

Keep keys safe

  • Keep keys on your server. Never put one in a web page, a mobile app or a code repository.
  • Read the key from an environment variable or a secrets manager, as the examples do with FILESOKAY_KEY.
  • Use a separate key for each app, so you can revoke one without stopping the others.

Revoke a key

In Settings, then API keys, select Revoke beside the key. It stops working from the next request. Members can revoke their own keys, and Admins any key in the Workspace.

When a key is refused

StatusCodeMeaning
401unauthorizedThe key is missing, unknown or revoked.
402subscription_requiredThe key’s Workspace has no active subscription.
401 response
{
  "code": "unauthorized",
  "detail": "Send a valid API key as a Bearer token.",
  "request_id": "5e6f235c2bfcaceb5e4d07a2a1ab3dbb",
  "status": 401,
  "title": "Unauthorized",
  "type": "about:blank"
}