Create namespace
const url = 'https://example.com/v1/ns?authority=document';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/yaml'}, body: 'example'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url 'https://example.com/v1/ns?authority=document' \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/yaml' \ --data exampleCreates a new namespace with an initial config version. Body is YAML or JSON config.
Authorization depends on parent: a child (parent supplied)
requires namespace:create-child on the parent and inherits its
partition; a root (parent omitted) requires namespace:create
on the target partition. A caller holding partition grants on
more than one partition must name the target with ?partition=
when creating a root — otherwise the request is 400 (ambiguous).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Parent namespace UUID (omit for root)
Target partition for a root namespace. Required only when the caller holds grants on multiple partitions; the caller must hold create rights on it. Cannot be combined with parent (a child inherits its parent’s partition).
Resource authority mode (default document)
Request Bodyrequired
Section titled “Request Bodyrequired”object
Examplegenerated
{}Responses
Section titled “Responses”Namespace created
object
UUID of the new namespace
ULID of the initial config version
Examplegenerated
{ "success": true, "nsid": "example", "new_version": "example"}default
Section titled “default”Error response
RFC 7807 Problem Details
object
Problem type slug URI
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example"}