Promote to Persistent
Endpoint: 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.
Headers
| Header | Value | Required | Notes |
|---|---|---|---|
Authorization | Bearer YOUR_API_KEY | yes | Account API key. Required on every request. |
Content-Type | application/json | no | Optional. The body is always parsed as JSON; if sent, application/json is accepted. |
Request body
A JSON array of output ids, taken from List Stored Outputs. Up to 50 per request.
curl -X POST "https://api.hiapi.ai/v1/storages/promote" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '["90216", "90215"]'
Response
{
"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 untilstorage_tierflips topersistent. When the switch completes the old temporary URL (on thetemphost) stops working — re-read the item to get the persistent URL instead of reusing the cached one.rejected— ids that were not promoted, each with a reason.
Rejection reasons
reason | Meaning |
|---|---|
not_owned | No such output for this account. |
insufficient | Account balance is at or below zero. The whole batch is rejected — top up, then retry. |
cap_exceeded | Promoting would exceed your persistent-storage cap. Free space or contact us to expand. |
not_promotable | Not a completed temporary output (already persistent, still generating, or failed). |
already_deleted | Output has already been deleted. |
storage_op_pending | Another storage operation is already in progress for this output — retry later. |
No demote
There is no way to move a persistent output back to temporary. To stop paying for it, delete it.
Up to 50 per call
Each request promotes at most 50 outputs. If you send more than 50 ids the whole request is rejected (HTTP 400) and nothing is promoted — split larger sets across several calls.