Skip to content
English

Promote to Persistent

POST /v1/storages/promote

Promotes one or more temporary outputs to persistent so they are kept long-term instead of expiring after about 7 days. Persistent storage is billed by size. Promotion is asynchronous and applies partial-success semantics.

Authorization Bearer YOUR_API_KEY required

Account API key. Required on every request.

Content-Type application/json required

The request body is JSON.

A JSON array of output ids — taken from List Stored Outputs and sent as strings. Up to 50 per request.

Terminal window
curl -X POST "https://api.hiapi.ai/v1/storages/promote" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '["90216", "90215"]'
{
"code": 200,
"message": "success",
"data": {
"accepted": ["90216"],
"rejected": [
{ "id": "90215", "reason": "cap_exceeded" }
]
}
}
  • accepted — ids queued for promotion. Promotion runs in the background; the output keeps the same path and switches to the persistent CDN domain once processed. Poll List Stored Outputs until storage_tier flips to persistent.
  • rejected — ids that were not promoted, each with a reason.
reasonMeaning
not_ownedNo such output for this account.
insufficientAccount balance is at or below zero. The whole batch is rejected — top up, then retry.
cap_exceededPromoting would exceed your persistent-storage cap. Free space or contact us to expand.
not_promotableNot a completed temporary output (already persistent, still generating, or failed).
already_deletedOutput has already been deleted.
storage_op_pendingAnother storage operation is already in progress for this output — retry later.