API keys
An API key belongs to an organisation, not to a person. It acts like a member of a project with one role, so a program using it can see and do what a person with that role can, and its changes are signed API · key name wherever Farkitect shows who changed something.
Keys are for programs. To give a person access, invite them to the organisation or the project instead.
Two kinds of key
Section titled “Two kinds of key”| Whole organisation | One project | |
|---|---|---|
| Reaches | Every project in the organisation, including ones made later | Exactly one project |
| Made by | The organisation’s owners and admins | Its owners and admins, and that project’s admins |
| Typical use | Reports and dashboards across everything | A tool for one team, or a product bought for one project |
A key never reaches another organisation, the organisation’s settings or its members.
| Role | The key may |
|---|---|
| Viewer | Read |
| Contributor | Read, and change models (M1) |
| Admin | As a project admin. For now the API only reads metamodels; metamodels are changed in the modeler |
Give a key the least it needs: for reports and documents, Viewer.
Making, extending and revoking
Section titled “Making, extending and revoking”Everything is in Organisation Settings › Developers. Owners and admins see every key in the organisation; a project’s admins see the keys for their projects. Every member of a project can see, on the project’s Members tab, which keys reach it.
- Make a key: see the quick start. It’s shown once.
- Expiry: every key expires, after 30 days, 90 days (the default), 6 months or a year. A week before, whoever made it and whoever can manage it are emailed.
- Extend gives it up to another year from today. It stays the same key, so nothing needs changing in the program using it.
- Revoke stops it at once, everywhere. It can’t be undone.
- Rotate a key by making a second one, moving the program to it, then revoking the first. Both work in between.
When someone leaves the organisation or a project, or stops being an admin, the keys they made keep working: programs shouldn’t stop because a person moved on. Whoever makes the change is shown the keys that person made, and offered the chance to replace them, since that person has seen them.
Keeping a key safe
Section titled “Keeping a key safe”- Keep it in an environment variable or a secrets manager, never in code. A key pushed to a public repository can be found within minutes.
- Send it only in the
Authorizationheader. A key in an address is refused, and should be treated as leaked: revoke it. - Never put it in a web page or a browser app: anyone using the page could read it, and the API refuses calls from browsers. For a web app, keep the key on a server: see Build with an AI assistant.
- One key per program, so each can be revoked without stopping the others.
Keys start fk_live_ (production) or fk_test_ (Farkitect’s test deployments), so a key is easy to recognise if it turns up somewhere it shouldn’t.