Skip to content

Create a Namespace

POST
/v1/organizations/{id}/namespaces
curl --request POST \
--url https://app.caprid.com/v1/organizations/4/namespaces \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "namespace": "acme-staging" }'

Gives the Organization another Namespace, such as acme-staging beside acme, so that staging’s Signing keys and Client tokens can’t reach prod. Any Member can create one, and so can an API key that isn’t limited to some Namespaces.

Names follow the same rules as at signup, and are unique across Switchboard for good. A name that any Namespace has ever had, including a deleted one, is never issued again.

An Organization can have 10 live Namespaces. Deleted ones don’t count. If you need more, ask Mux to raise the cap.

A new Namespace starts with platform_peering off.

id
required
integer

The Organization’s id, from GET /v1/organizations.

Example

4
Media typeapplication/json
object
namespace
required

A Namespace’s name, which is the root of every path signed for it. It never changes. Use lowercase letters, digits and hyphens, and start and end with a letter or digit. Some names, like admin and default, are reserved, and so is every name that starts with trial-, which only Trial Organizations get.

string
>= 3 characters <= 32 characters /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/

Example

{
"namespace": "acme-staging"
}

The new Namespace.

Media typeapplication/json
object
name
required

A Namespace’s name, which is the root of every path signed for it. It never changes. Use lowercase letters, digits and hyphens, and start and end with a letter or digit. Some names, like admin and default, are reserved, and so is every name that starts with trial-, which only Trial Organizations get.

string
>= 3 characters <= 32 characters /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/
organization_id
required

The Organization that owns it, for good.

integer
platform_peering
required

Whether its tracks may travel between your Self-hosted relays and Platform relays, the relays Mux runs.

boolean
created_at
required
integer

Example

{
"name": "acme-staging",
"organization_id": 7,
"platform_peering": false,
"created_at": 1790294400
}

The request is malformed or a field is invalid. The message says which.

Media typeapplication/json
object
error
required
string

Example

{
"error": "the requested grants exceed the key's scope"
}

No valid credential. Missing, expired and revoked credentials all get the same response, and so does an API key whose trial has lapsed. An Agent token from before a claim gets a 401 too, once the claim has made the trial a person’s, with a message saying to get a new token.

Media typeapplication/json
object
error
required
string

Example

{
"error": "the requested grants exceed the key's scope"
}
WWW-Authenticate
string
Example
Bearer realm="switchboard"

The Organization already has as many Namespaces as it may, or you sent an API key limited to some Namespaces. The message says which.

Media typeapplication/json
object
error
required
string

Example

{
"error": "an Organization may have 10 Namespaces, and this one has; delete one, or ask whoever runs this Switchboard to raise the cap"
}

No such thing, or not yours. Another customer’s Organization or Namespace is a 404 too, so nobody can tell which ones exist.

Media typeapplication/json
object
error
required
string

Example

{
"error": "the requested grants exceed the key's scope"
}

The name is taken, or was once.

Media typeapplication/json
object
error
required
string

Example

{
"error": "the name acme-staging is taken, or was once: a Namespace's name is never reissued"
}