Skip to content

Create an organization

POST
/organizations
curl --request POST \
--url https://api.perstat.io/organizations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example" }'

Creates a new organization owned by the caller; the URL slug is derived from the name. Returns 409 when the per-user organization limit is reached or the slug is already taken. API keys require the explicit org:create scope and an organization-wide key whose creator is currently an owner. The new organization is owned by that creator; the key remains bound to its original organization and cannot access resources in the new organization. Accepts API keys with the org:create scope, subject to current role and resource grants.

Media typeapplication/json
object
name
required
string
Examplegenerated
{
"name": "example"
}

Resource created. The response body contains the created resource.

Media typeapplication/json
object
id
required
string
name
required
string
slug
required
string
Examplegenerated
{
"id": "example",
"name": "example",
"slug": "example"
}

The request is invalid. Check the supplied fields and values.

Authentication is missing or invalid.

The request conflicts with the current resource state.