Skip to content
Docs menu
Getting started

Authentication

Send your switchfile API key as a bearer token. Live keys, sandbox keys, service keys and the endpoints that need no key.

Send the key as a bearer token#

Every request to the API sends the key in the Authorization header:

Text
Authorization: Bearer sf_live_...
curl https://api.switchfile.io/v1/account \
  -H "Authorization: Bearer $SWITCHFILE_API_KEY"

A key that is missing or revoked returns 401 with the code UNAUTHENTICATED.

Kinds of keys#

KeyPrefixWhat it does
Live keysf_live_Converts files and uses your free quota, then your credits
Sandbox keysf_test_Works the same way and never uses credits. See Sandbox
Service keysf_live_For websites and apps that convert files for their own visitors. It can send X-End-User, see Limits and quotas

Create and revoke live and sandbox keys in the dashboard under API keys. An account can have up to 25 active keys. The full key is shown once, when you create it. A revoked key stops working right away. Service keys are set up on request, write to [email protected].

Keep the key on your server#

The key gives full access to your account and its credits. Keep it in an environment variable or a secret store and send requests from your server. Do not put it into a public repository or into code that runs on your users' devices. If a key leaks, revoke it in the dashboard and create a new one.

Endpoints without a key#

These work without an API key:

  • GET /v1/formats and GET /v2/convert/formats: the list of supported conversions
  • Signed URLs that the API returns for downloads and uploads, including ZIP archives. The signature in the URL is the permission, so you can hand these URLs to a browser.
  • GET /health

Coming from CloudConvert#

Jobs and tasks (/v2) read the key from the same Authorization: Bearer header as the CloudConvert API v2. Replace the CloudConvert key with a switchfile key and the base URL with https://api.switchfile.io.