Skip to content

Image Services

POST /v1/images/keys · scope images:keys · reversible · idempotent

Returns the full imgt_… token, exactly once: only its hash is stored, so there is no way to show it again. If it is lost, rotate or mint another.

This token does not work against this API: it authenticates the delivery plane — GET {api_endpoint}/v1/img?url=… for transformations and POST {api_endpoint}/v1/sign to sign URLs. Delivery deliberately does not go through api.truo.cloud: one extra hop on every <img> of every page is one extra failure mode.

It requires images:keys rather than images:write because holding this token is the ability to serve — and bill — traffic through the account’s tenant.

Terminal window
curl https://api.truo.cloud/v1/images/keys \
-X POST \
-H "Authorization: Bearer $TRUO_TOKEN"

operationId: images.keys.create

POST /v1/images/keys/rotate · scope images:keys · destructive — cannot be undone · idempotent

Issues a new token and returns it. With grace_seconds, the previous token keeps working that long, so servers holding it do not fail at the instant of rotation; with 0 (the default) it dies immediately. There is no going back: the old token cannot be reactivated.

Terminal window
curl https://api.truo.cloud/v1/images/keys/rotate \
-X POST \
-H "Authorization: Bearer $TRUO_TOKEN"

operationId: images.keys.rotate

POST /v1/images/origins · scope images:write · reversible · idempotent

Adds a hostname (images.example.com) or a wildcard (*.example.com) to the allowlist. Idempotent: re-adding an existing pattern changes nothing. Each plan caps how many origins it can hold; past the cap this returns quota_exceeded.

Terminal window
curl https://api.truo.cloud/v1/images/origins \
-X POST \
-H "Authorization: Bearer $TRUO_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'

operationId: images.origins.add

GET /v1/images/origins · scope images:read

The hostnames the service is allowed to fetch from. Fail-closed: an empty allowlist serves nothing, on purpose — an open image proxy is an attack tool.

Terminal window
curl https://api.truo.cloud/v1/images/origins \
-H "Authorization: Bearer $TRUO_TOKEN"

operationId: images.origins.list

DELETE /v1/images/origins/{pattern} · scope images:write · reversible · idempotent

Stops serving from that origin immediately. Reversible: adding the pattern back restores it. If it was the last origin, the tenant serves nothing until one is added — the allowlist is fail-closed.

Terminal window
curl https://api.truo.cloud/v1/images/origins/cdn.example.com \
-X DELETE \
-H "Authorization: Bearer $TRUO_TOKEN"

operationId: images.origins.remove

POST /v1/images/signing-secret · scope images:keys

Returns the per-tenant HMAC-SHA256 secret that signs delivery URLs. It is a POST on purpose, even though it changes nothing: a GET that returns a secret lands in browser history, in any proxy’s cache, and in yesterday’s curl. A POST forces a deliberate action, is not cacheable, and enters the audit log as a mutation.

The secret is recoverable (stored, not hashed) because your server needs it whole to sign every URL it emits. It belongs on the server, never in the browser: anyone holding it can mint URLs that serve — and bill — through your tenant. If it was compromised, rotate it with POST /v1/images/signing-secret/rotate.

Terminal window
curl https://api.truo.cloud/v1/images/signing-secret \
-X POST \
-H "Authorization: Bearer $TRUO_TOKEN"

operationId: images.signing.reveal

POST /v1/images/signing-secret/rotate · scope images:keys · destructive — cannot be undone · idempotent

Issues a new secret and returns it. URLs signed with the previous secret keep working until previous_valid_until (per grace_seconds) — without a grace window, every <img> already rendered in your pages would break at the instant of rotation. Re-sign and redeploy before the window closes.

Terminal window
curl https://api.truo.cloud/v1/images/signing-secret/rotate \
-X POST \
-H "Authorization: Bearer $TRUO_TOKEN"

operationId: images.signing.rotate

GET /v1/images · scope images:read

It takes no id: there is one Image Services tenant per account. Returns the plan, the month’s usage, and how many origins are allowed. origin_count: 0 means nothing is served yet — the allowlist is fail-closed. If the account does not have the service, it returns 404.

Terminal window
curl https://api.truo.cloud/v1/images \
-H "Authorization: Bearer $TRUO_TOKEN"

operationId: images.tenant.get

Get the period’s usage and billable line

Section titled “Get the period’s usage and billable line”

GET /v1/images/usage · scope images:read

Consumption against the plan for the period: transformations (cache misses — real CPU work), deliveries, egress bytes, what the quota includes, the overage, and the total in USD. Includes the daily series. On a hard-capped plan (included.hard_cap) the overage is never billed: the service stops at the quota instead.

Terminal window
curl https://api.truo.cloud/v1/images/usage \
-H "Authorization: Bearer $TRUO_TOKEN"

operationId: images.usage.get