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

Cancel an unclaimed native material preparation

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

POST /v1/media/operations/{id}/cancel

Current selected key, exact model/account/channel and workspace Write authority required. Safe Niu references only; no Provider identifiers, source URLs, credentials or procurement prices returned. Only prepared can transition to not_sent; a not_sent replay is unchanged. Unknown or acknowledged returns409 and cannot be canceled. No Provider call. This key-scoped endpoint requires current original-key authority; use the workspace historical cancellation endpoint after key expiry or revocation.

Operation: cancelPreparedProviderAssetOperation.

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

JSON
[
{
"bearerAuth": []
},
{
"niuApiKeyAuth": []
}
]

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.

Authentication alternative: bearerAuth.

Shell
curl --fail-with-body -X POST "$NIU_ORIGIN/v1/media/operations/{id}/cancel" \
-H "Authorization: Bearer $NIU_BEARER_TOKEN" \
--url-query 'model=<MODEL>'

Authentication alternative: niuApiKeyAuth.

Shell
curl --fail-with-body -X POST "$NIU_ORIGIN/v1/media/operations/{id}/cancel" \
-H "X-Niu-API-Key: $NIU_API_KEY" \
--url-query 'model=<MODEL>'

Location: path. Required.

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

Location: query. Required.

JSON
{
"type": "string"
}

No request body is declared.

Saved operation metadata

Response headers:

JSON
{
"Cache-Control": {
"schema": {
"type": "string"
},
"description": "no-store"
}
}

Content type: application/json.

JSON
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"type": "object",
"required": [
"id",
"group_id",
"model",
"action",
"status",
"created_at_ms",
"updated_at_ms"
],
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"group_id": {
"type": "string",
"format": "uuid"
},
"asset_id": {
"type": [
"string",
"null"
],
"format": "uuid"
},
"model": {
"type": "string"
},
"action": {
"type": "string",
"enum": [
"create_group",
"update_group",
"delete_group",
"create_asset",
"rename_asset",
"delete_asset"
]
},
"status": {
"type": "string",
"enum": [
"prepared",
"unknown",
"acknowledged",
"not_sent"
]
},
"http_status": {
"type": [
"integer",
"null"
]
},
"request_id": {
"type": [
"string",
"null"
]
},
"diagnostic": {
"description": "Sanitized observed failure category and phase. Null for older records or when no diagnostic was saved. Does not establish nonexecution or authorize replay.",
"type": [
"object",
"null"
],
"additionalProperties": false,
"required": [
"category",
"phase"
],
"properties": {
"category": {
"type": "string",
"enum": [
"transport",
"timeout",
"response_too_large",
"invalid_response",
"upstream_rejected"
]
},
"phase": {
"type": "string",
"enum": [
"exchange",
"response",
"acknowledgement"
]
}
}
},
"created_at_ms": {
"type": "integer",
"format": "int64"
},
"updated_at_ms": {
"type": "integer",
"format": "int64"
}
}
}
}
}

Invalid input or missing idempotency UUID

Missing expired or revoked key/session

Workspace Write or key policy refused

Owned preparation or model unavailable

Changed canonical input, stale revision, route or operation state conflict

Request exceeds16KiB

Channel unsupported

Storage or configuration unavailable

Current selected key, exact model/account/channel and workspace Write authority required. Safe Niu references only; no Provider identifiers, source URLs, credentials or procurement prices returned. Only prepared can transition to not_sent; a not_sent replay is unchanged. Unknown or acknowledged returns409 and cannot be canceled. No Provider call. This key-scoped endpoint requires current original-key authority; use the workspace historical cancellation endpoint after key expiry or revocation.

Supported scope: implemented