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

Get or create the installation default workspace

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

POST /api/v1/setup/default-workspace

Installation credential only. First use atomically creates company/workspace ownership and a zero-funded USD balance account with zero approved credit. Repeated and concurrent calls reuse the designated default. Existing defaults retain their billing configuration. Development login uses the same first-use initializer. No API key, payment receipt or spending capacity is created. No request body is required. The legacy project_id field identifies the workspace; these identifiers are routing references, not display labels.

Operation: getOrCreateDefaultWorkspace.

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/setup/default-workspace" \
-H "Authorization: Bearer $NIU_BEARER_TOKEN"

No path, query, or header parameters are declared.

No request body is declared.

Stable default ownership references, without a data wrapper.

Content type: application/json.

JSON
{
"type": "object",
"required": [
"organization_id",
"project_id"
],
"additionalProperties": false,
"properties": {
"organization_id": {
"type": "string",
"format": "uuid"
},
"project_id": {
"type": "string",
"format": "uuid",
"description": "Workspace routing identifier."
}
}
}

Missing, invalid, expired or inference-only credential.

Authenticated member lacks installation authority, including a platform administrator.

Installation credential only. First use atomically creates company/workspace ownership and a zero-funded USD balance account with zero approved credit. Repeated and concurrent calls reuse the designated default. Existing defaults retain their billing configuration. Development login uses the same first-use initializer. No API key, payment receipt or spending capacity is created. No request body is required. The legacy project_id field identifies the workspace; these identifiers are routing references, not display labels.

Supported scope: implemented