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.
Headers
Section titled “Headers”Authorization Bearer YOUR_API_KEY required Account API key. Required on every request.
Content-Type application/json required The request body is JSON.
Request body
Section titled “Request body”A JSON array of output ids — taken from List Stored Outputs and sent as strings. 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
Section titled “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.rejected— ids that were not promoted, each with a reason.
Rejection reasons
Section titled “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. |