Organisationer & workspaces
Oversigt
qr3.app bruger et hierarki i to niveauer:
Organization (Firma/Agentur) └── Workspace 1 (Kunde A) └── Workspace 2 (Kunde B) └── Workspace 3 (Internes Team)- Organisation — øverste niveau, tilknyttet en Stripe-konto og -abonnement
- Workspace — isoleret område til QR-koder, scanninger og API-keys
Organizations API
GET /v1/organizations
Returnerer den organisation, som den aktuelle API-key tilhører.
curl https://qr3.app/v1/organizations \ -H "Authorization: Bearer qr3_sk_..."POST /v1/organizations
Opretter en ny organisation.
curl -X POST https://qr3.app/v1/organizations \ -H "Authorization: Bearer qr3_sk_..." \ -H "Content-Type: application/json" \ -d '{ "name": "Digital Heroes GmbH", "slug": "digital-heroes", "billing_email": "[email protected]" }'Felter:
| Felt | Type | Påkrævet | Beskrivelse |
|---|---|---|---|
name | string | ✅ | Visningsnavn (maks. 255 tegn) |
slug | string | ✅ | URL-venlig, unik (min. 2, maks. 63 tegn, kun a-z0-9-) |
billing_email | string | — | Fakturerings-e-mail |
PATCH /v1/organizations/:id
curl -X PATCH https://qr3.app/v1/organizations/org_a1b2c3 \ -H "Authorization: Bearer qr3_sk_..." \ -H "Content-Type: application/json" \DELETE /v1/organizations/:id
Soft-delete af organisationen. Alle tilhørende workspaces og QR-koder bevares, men er ikke længere tilgængelige.
Workspaces API
GET /v1/workspaces
Vis alle workspaces for organisationen.
curl https://qr3.app/v1/workspaces \ -H "Authorization: Bearer qr3_sk_..."POST /v1/workspaces
Opret et nyt workspace.
curl -X POST https://qr3.app/v1/workspaces \ -H "Authorization: Bearer qr3_sk_..." \ -H "Content-Type: application/json" \ -d '{ "name": "Kunde Bäckerei Schmidt", "slug": "baeckerei-schmidt", "default_locale": "de", "primary_color": "#8B4513", "approval_required": false }'Felter:
| Felt | Type | Standard | Beskrivelse |
|---|---|---|---|
name | string | — | Visningsnavn (påkrævet) |
slug | string | — | URL-venlig, unik pr. org (påkrævet) |
default_locale | string | de | Standardsprog |
approval_required | boolean | false | Aktiver godkendelsesworkflow |
primary_color | string | — | Branding-farve (#RRGGBB) |
Abonnementsgrænser:
| Abonnement | Maks. workspaces |
|---|---|
| Free | 1 |
| Pro | 3 |
| Business | 10 |
| Agency | Ubegrænset |
PATCH /v1/workspaces/:id
curl -X PATCH https://qr3.app/v1/workspaces/ws_xyz789 \ -H "Authorization: Bearer qr3_sk_..." \ -H "Content-Type: application/json" \ -d '{ "name": "Neuer Name", "approval_required": true, "custom_domain": "qr.baeckerei-schmidt.de" }'DELETE /v1/workspaces/:id
Arkiverer workspacet. Kan ikke anvendes på ens eget workspace.
Audit-logs
GET /v1/audit-logs
Sporbar log over alle ændringer i workspacet.
curl "https://qr3.app/v1/audit-logs?resource_type=codes&limit=50" \ -H "Authorization: Bearer qr3_sk_..."Query-parametre:
| Parameter | Type | Beskrivelse |
|---|---|---|
resource_type | string | Filtrer efter ressource: codes, api_keys, webhooks, workspaces |
resource_id | string | Filtrer efter specifik ressource-ID |
action | string | Filtrer efter handling (f.eks. codes.created) |
cursor | string | Paginerings-cursor |
limit | integer | Maks. 100 (standard: 50) |
Eksempel-response:
{ "data": [ { "id": "aud_a1b2c3", "actor_type": "api", "action": "codes.created", "resource_type": "codes", "resource_id": "qr_xyz123", "changes": {}, "created_at": "2026-03-15T10:00:00.000Z" } ]}