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/json
  • Content-Type: application/json
  • x-api-key โ€” parent organisation API key.

Body

FieldTypeRequiredDescription
namestringYesKey name (1โ€“255 characters)
scopesstring[]NoScope 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_atstringNoISO 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 Conflict if limit is reached.
  • expires_at must be a future date. Returns 400 Bad Request for past dates.
  • Caller must be a top-level organisation (not a child).
  • The x-acting-as header must not be set.
  • The created_by_organization_id is automatically set to the parent org.
  • The body is validated strictly: an unknown attribute returns 400 Bad Request rather than being ignored. key_type is assigned by the server and cannot be set by the caller.

Required scope: organizations:write