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

Create a platform upstream cost budget (installation only)

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

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

Fails with conflict if a budget exists. Previously dispatched work is not retroactively reserved. Further dispatch requires a trusted held reservation; configure pricing separately in the model route.

Operation: createProjectBudget.

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

JSON
[
{
"adminBearerAuth": []
}
]

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/{project}/budget" \
-H "Authorization: Bearer $NIU_ADMIN_TOKEN" \
-H 'Content-Type: application/json' \
--data @request.json

Location: path. Required.

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

Location: path. Required.

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

Required.

JSON
{
"type": "object",
"additionalProperties": false,
"required": [
"currency",
"limit_nanos"
],
"properties": {
"currency": {
"type": "string",
"pattern": "^[A-Z]{3}$"
},
"limit_nanos": {
"type": "string",
"pattern": "^[0-9]+$",
"description": "Nonnegative integer billionths of currency, at most 9223372036854775807."
}
}
}

Created budget snapshot with decimal-string amounts and lifetime period.

Invalid currency or amount.

Administrator authentication required.

Budget already exists or the workspace is absent from the organization.

JSON does not match the required schema.

Fails with conflict if a budget exists. Previously dispatched work is not retroactively reserved. Further dispatch requires a trusted held reservation; configure pricing separately in the model route.