Create Child Key
Create a new API key for a child organisation.
The response includes the plaintext key in attributes.key. This is the only time the full key is returned โ store it securely. Subsequent list or get operations only show the last four characters.
The key is stored as a salted hash in the database. An encrypted copy is also stored for potential recovery.
โถRequest
โถMethod & Path
POST /organizations/children/:id/keys
โถPath parameters
idโ UUID of the child organisation.
โถHeaders
Accept: application/jsonContent-Type: application/jsonx-api-keyโ parent organisation API key.
โถBody
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Key name (1โ255 characters) |
scopes | string[] | No | Scope restrictions. Omit or pass an empty array for unrestricted access. See Scopes for all valid values. Use ["eudr:reference"] for access only to EUDR reference lookups. |
expires_at | string | No | ISO 8601 expiration timestamp. Must be in the future. |
โถReference-only EUDR key
Set data.attributes.scopes to ["eudr:reference"] to allow only:
GET /regulations/eudr/scopeโ classify an HS code.GET /regulations/eudr/scope/entriesโ list Annex I entries.GET /regulations/eudr/speciesโ list species.
Other scope-protected endpoints return 403 Insufficient scope with the new
key. The parent key used to create it still needs organizations:write.
Existing keys with eudr:read continue to have access to these lookups.
โถConstraints
- Maximum 20 manually-created keys per child organisation. Returns
409 Conflictif limit is reached. expires_atmust be a future date. Returns400 Bad Requestfor past dates.- Caller must be a top-level organisation (not a child).
- The
x-acting-asheader must not be set. - The
created_by_organization_idis automatically set to the parent org. - The body is validated strictly: an unknown attribute returns
400 Bad Requestrather than being ignored.key_typeis assigned by the server and cannot be set by the caller.
Required scope:
organizations:write