Namespaces
Create Namespace
Create a namespace with a unique name and a display name.
POST https://api.rivet.dev/namespaces
Examples
curl -X POST "https://api.rivet.dev/namespaces" \
-H "Authorization: Bearer $RIVET_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "my-app",
"display_name": "My App"
}'
const endpoint = "https://api.rivet.dev";
const token = process.env.RIVET_TOKEN ?? "";
const response = await fetch(`${endpoint}/namespaces`, {
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ name: "my-app", display_name: "My App" }),
});
const { namespace } = await response.json();
console.log(namespace);
export {};
Authentication
Send your namespace token as a bearer token in the Authorization header. Every control plane request also requires the namespace query parameter. See Authentication.
Request Body
Content type: application/json.
| Field | Type | Required | Description |
|---|---|---|---|
display_name | string | Yes | Human-readable name for the namespace. |
name | string | Yes | Unique name used to identify the namespace. |
Responses
200
The newly created namespace.
| Field | Type | Description |
|---|---|---|
namespace | object | Name of the namespace to operate in. |
namespace.create_ts | integer | |
namespace.display_name | string | |
namespace.name | string | |
namespace.namespace_id | string |
{
"namespace": {
"create_ts": 1700000000000,
"display_name": "<display_name>",
"name": "my-actor",
"namespace_id": "00000000-0000-0000-0000-000000000000"
}
}