Authentication
All API requests require authentication using an API key.
How It Works
Include your API key in the Authorization header using Bearer authentication:
Code
Getting Your API Key
- Log in to your Teachfloor account
- Navigate to Settings → Integrations
- Click Create API Key and give it a name, such as the service that will use it
- Copy the key from the confirmation dialog and store it securely
The key is shown once. Afterwards the Integrations page lists only its name, a masked form (tf_key_••••••••wxyz) and when it was last used. You can create as many keys as you need, one per integration, and revoke any of them without affecting the others.
Keys created before named keys were introduced keep working unchanged.
Security: Never share your API key publicly or commit it to version control.
A request with a missing or unknown key is answered with 403 Forbidden and the standard error envelope. A valid key on a plan without the Public API is answered with 402 Payment Required.
Example Request
Code
Code
Code
Rotating a Key
To replace a key without touching the others:
- Go to Settings → Integrations
- Open the key's menu and click Rotate
- Copy the new key from the confirmation dialog
Warning: Rotating revokes the previous secret immediately. Update the application using it before or right after rotating. If you need an overlap window, create a second key, move the application to it, then revoke the first one.
To stop a key for good, choose Revoke from the same menu. Revoked keys are refused with 403 Forbidden on their next request.
Best Practices
- Store API keys in environment variables
- Never hardcode keys in your application
- Rotate immediately if compromised
- Use one key per integration so a leak is contained and
last usedtells you which key is live
Next Steps
- Rate Limiting - Understand usage limits
- Errors - Handle API errors