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

List saved workspace API-key metadata

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

GET /api/v1/organizations/{organization}/projects/{project}/keys

Requires workspace read access. Workspace API keys do not authorize these management operations. Returns the complete saved directory in creation-time/routing-reference order; this compatibility response has no continuation cursor. Storage reads use transaction-local 250 ms lock and 2 s statement limits. Timeout returns sanitized 503, never empty or truncated success; pool admission and the complete HTTP deadline are separate. Internal IDs are API routing references, not product labels. Supplying limit or after selects a bounded keyset page and adds next_cursor; without either, the complete compatibility response is unchanged.

Operation: listKeys.

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 GET "$NIU_ORIGIN/api/v1/organizations/{organization}/projects/{project}/keys" \
-H "Authorization: Bearer $NIU_BEARER_TOKEN"

Location: path. Required.

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

Location: path. Required.

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

Location: query. Optional. Explicit limit selects paginated mode (1 to 100). With after but no limit, page size is 50. Omit both for the full compatibility directory.

JSON
{
"type": "integer",
"minimum": 1,
"maximum": 100
}

Location: query. Optional. Exclusive key routing reference from next_cursor. Missing or foreign-workspace cursors return 409. Each page shares one snapshot with its cursor lookup; traversal is a live view.

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

No request body is declared.

Scoped metadata, never token hashes or secrets. Last used is the latest durable dispatch intent, including uncertain attempts; it is not authentication time or proof of upstream completion.

Content type: application/json.

JSON
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"revision",
"name",
"allowed_models",
"expires_at_ms",
"last_used_at_ms",
"revoked",
"expired",
"slug"
],
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"revision": {
"type": "integer",
"format": "int64",
"minimum": 1
},
"name": {
"type": "string"
},
"allowed_models": {
"type": "array",
"items": {
"type": "string"
}
},
"expires_at_ms": {
"type": [
"integer",
"null"
],
"format": "int64",
"description": "Unix milliseconds for finite expiration. Null means no automatic expiration, not an invalid or unknown timestamp. Rotation preserves this state."
},
"last_used_at_ms": {
"type": [
"integer",
"null"
],
"format": "int64",
"description": "Latest durable dispatch intent in Unix milliseconds. Null means no attributed dispatch is recorded, not that the credential was never authenticated. Rotation preserves the old key's history; its replacement starts without a dispatch record."
},
"revoked": {
"type": "boolean"
},
"expired": {
"type": "boolean"
},
"slug": {
"type": "string",
"maxLength": 48,
"pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
"description": "Stable readable slug for product URLs. Renaming preserves it."
}
}
}
},
"next_cursor": {
"type": [
"string",
"null"
],
"format": "uuid",
"description": "Present only when limit or after is supplied. Null when the paginated range ends. Internal routing reference, not a product label."
}
}
}

Invalid limit or cursor syntax.

Invalid or expired administrative credential.

Content type: application/json.

JSON
{
"type": "object",
"required": [
"error"
],
"description": "Gateway application error envelope. This does not describe framework body/path parsing failures or a proxy-generated response. Branch on error.type and HTTP status rather than matching message text.",
"properties": {
"error": {
"type": "object",
"required": [
"message",
"type",
"param",
"code"
],
"properties": {
"message": {
"type": "string",
"description": "Safe human-readable explanation; not a stable programmatic identifier."
},
"type": {
"type": "string",
"description": "Machine-readable failure category; new categories may be added."
},
"param": {
"type": "null"
},
"code": {
"type": "integer",
"minimum": 400,
"maximum": 599,
"description": "HTTP status code, not a separate application error number."
}
}
}
}
}

Workspace outside authorized scope.

Content type: application/json.

JSON
{
"type": "object",
"required": [
"error"
],
"description": "Gateway application error envelope. This does not describe framework body/path parsing failures or a proxy-generated response. Branch on error.type and HTTP status rather than matching message text.",
"properties": {
"error": {
"type": "object",
"required": [
"message",
"type",
"param",
"code"
],
"properties": {
"message": {
"type": "string",
"description": "Safe human-readable explanation; not a stable programmatic identifier."
},
"type": {
"type": "string",
"description": "Machine-readable failure category; new categories may be added."
},
"param": {
"type": "null"
},
"code": {
"type": "integer",
"minimum": 400,
"maximum": 599,
"description": "HTTP status code, not a separate application error number."
}
}
}
}
}

Missing or foreign-workspace cursor.

Requires workspace read access. Workspace API keys do not authorize these management operations. Returns the complete saved directory in creation-time/routing-reference order; this compatibility response has no continuation cursor. Storage reads use transaction-local 250 ms lock and 2 s statement limits. Timeout returns sanitized 503, never empty or truncated success; pool admission and the complete HTTP deadline are separate. Internal IDs are API routing references, not product labels. Supplying limit or after selects a bounded keyset page and adds next_cursor; without either, the complete compatibility response is unchanged.

Supported scope: implemented