Skip to content
Niu DocsNiu 牛元文档
Dashboard控制台

Create a workspace in the selected company

Generated from the checked-in source. Do not edit this reference by hand.

POST /api/v1/organizations/{organization}/projects

Legacy workspace-compatible endpoint. Uses the same company creation authorization and actor-scoped durable Idempotency-Key identity as canonical workspace creation. Returns only id, organization_id and name. Identical retries preserve one workspace; changed retry documents conflict. Workspace members cannot create sibling workspaces. New workspaces do not create funding or credit. Request fields other than name are ignored by the legacy parser.

Operation: createOrganizationWorkspace.

Use the credential and permission scope described above. Each object below is an alternative; schemes within one object are required together.

JSON
[
{
"bearerAuth": []
}
]

Set NIU_ORIGIN to your installation origin (without /v1). Replace path, query and header placeholders with the required values. Query examples use curl 7.87 or newer to encode values with --url-query. Use the credential scope described above; a bearer token must have the authority required by this operation.

Shell
curl --fail-with-body -X POST "$NIU_ORIGIN/api/v1/organizations/{organization}/projects" \
-H "Authorization: Bearer $NIU_BEARER_TOKEN" \
-H 'Content-Type: application/json' \
--data @request.json

Location: path. Required.

JSON
{
"type": "string",
"format": "uuid"
}

Location: header. Optional. Visible ASCII durable retry identity, scoped to the actor.

JSON
{
"type": "string",
"minLength": 1,
"maxLength": 128
}

Required.

JSON
{
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
}
}
}

Created workspace or durable replay of its current identity.

Content type: application/json.

JSON
{
"type": "object",
"required": [
"id",
"organization_id",
"name"
],
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"name": {
"type": "string"
},
"organization_id": {
"type": "string",
"format": "uuid"
}
}
}

Invalid name or idempotency header.

Authentication required.

Workspace creation denied.

Company outside authorized scope.

Conflicting idempotency document.

Missing or type-invalid name in JSON body.

Storage unavailable.

Legacy workspace-compatible endpoint. Uses the same company creation authorization and actor-scoped durable Idempotency-Key identity as canonical workspace creation. Returns only id, organization_id and name. Identical retries preserve one workspace; changed retry documents conflict. Workspace members cannot create sibling workspaces. New workspaces do not create funding or credit. Request fields other than name are ignored by the legacy parser.

Supported scope: implemented