- Dokumentasjon
- Utviklere
- API keys
Denne siden finnes ikke på Norsk bokmål ennå. Den vises på engelsk.
API keys
Create an API key so scripts and integrations can call your Vigiora server as you, then revoke it when it's no longer needed.
I appen: /api-keys
An API key lets a script or integration, such as Home Assistant, call your server's API v1 (and the internal API) as you. It has your role and your camera permissions, never more.
Everyone can create keys for themselves. Admins can also see and revoke other people's keys.
Create a key#
Open API keys
Open Settings → People and access → API keys, then New key.
Name it
Enter a Name that says where you'll use it, for example Home Assistant.
Choose read-only or read-write
Leave Read-only ticked unless the integration needs to change things.
Choose when it expires
Pick Expires: Never, 7 days, 30 days, 90 days or 1 year.
Create it
Click Create key.
Copy the key now
Click Copy and store the key in your integration or a password manager. Then click I've copied it.
A key looks like vgk_xxxxxxxx_xxxxxxxxxxxxxxxx. The first part (vgk_ and the key ID) is its prefix. The list shows the prefix so you can tell keys apart.
Options#
| Alternativ | Beskrivelse | Standard |
|---|---|---|
| Name | 1 to 100 characters. Only for you to recognise the key. | — |
| Read-only | Only GET requests are allowed. Untick to let the key make changes with your permissions. | On |
| Expires | Never, 7 days, 30 days, 90 days or 1 year. An expired key stops working. | Never |
You can have up to 20 active keys.
Use a key#
Send it in a header:
curl -s https://yourname.vigiora.com/api/v1/cameras \
-H "Authorization: Bearer vgk_xxxxxxxx_xxxxxxxxxxxxxxxx"or X-API-Key: vgk_xxxxxxxx_xxxxxxxxxxxxxxxx. See the API quickstart for what you can call.
What a key can't do#
- Keys can't manage keys, users, groups or passwords, and can't change Vigiora cloud, remote access or billing settings.
- A key never sees camera passwords: they come back as
REDACTED. - A key stops working at once if it's revoked or expires, or if its user is disabled. Open live streams are closed within 30 seconds.
The key list#
| Column | Meaning |
|---|---|
| Name | The name you gave it, with a Read-only or Read-write badge and the prefix. |
| User | Whose key it is. Shown to admins with All users ticked. |
| Created | When it was created. |
| Last used | The last request made with it, updated about once a minute. |
| Expires | The expiry date, or Never. |
| Status | active, expired or revoked. |
| Ask before actions | Whether AI agents using the key must get your approval before risky actions: Use server setting, Always ask or Never ask. See Human in the loop. From 1.6.9. |
AI agents and human in the loop#
When an AI agent uses a key through the MCP server, the key's Ask before actions menu decides whether the agent asks you before it moves cameras, scans the network or changes settings. New keys use the server setting, which is on by default. While the server setting is on, only admins can choose Never ask. Scripts calling the REST API are never prompted. See Human in the loop.
Revoke a key#
Find the key
In Settings → People and access → API keys, find the key. Admins can tick All users to see everyone's keys.
Revoke it
Click Revoke and confirm. Anything using the key stops working immediately.
Too many wrong keys#
Repeated requests with wrong keys from one address are slowed down. The server answers 429 with a Retry-After header saying how many seconds to wait.