Create a Namespace
const url = 'https://app.caprid.com/v1/organizations/4/namespaces';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"namespace":"acme-staging"}'};
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://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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The Organization’s id, from GET /v1/organizations.
Example
4Request Bodyrequired
Section titled “Request Bodyrequired”object
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.
Example
{ "namespace": "acme-staging"}Responses
Section titled “Responses”The new Namespace.
object
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.
The Organization that owns it, for good.
Whether its tracks may travel between your Self-hosted relays and Platform relays, the relays Mux runs.
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.
object
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.
object
Example
{ "error": "the requested grants exceed the key's scope"}Headers
Section titled “Headers”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.
object
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.
object
Example
{ "error": "the requested grants exceed the key's scope"}The name is taken, or was once.
object
Example
{ "error": "the name acme-staging is taken, or was once: a Namespace's name is never reissued"}