Skip to content

Media imports

POST /apps/media/imports — scope write_media, Idempotency-Key required.

You send public image URLs; CIQRA downloads them into the store’s media library and returns asset ids you can reference elsewhere (for example in a metaobject field).

{ "urls": ["https://cdn.your-app.example/cars/1234/front.jpg", ""] }

1 to 100 URLs per request.

Rule Detail
Scheme https only
Address must resolve to public addresses; private, loopback and link-local targets are refused (checked again at connect time)
Redirects not followed — give the final URL
Timeout 30 seconds per URL
Size up to 20 MB
Type PNG, JPEG, GIF or WebP, detected from the bytes, not from the extension or Content-Type

Response — always 200 for a valid request

Section titled “Response — always 200 for a valid request”
{
"requested": 2, "succeeded": 2, "failed": 0, "fetched": 1,
"results": [
{ "url": "https://…/front.jpg", "status": "imported", "mediaAssetId": "", "assetUrl": "https://…" },
{ "url": "https://…/rear.jpg", "status": "already_present", "mediaAssetId": "", "assetUrl": "https://…" }
]
}
status Meaning
imported Downloaded and stored as a new asset.
already_present This URL was imported recently (24 h); the existing asset is returned without downloading.
unchanged Downloaded, but identical bytes already exist; the existing asset is returned.
failed See errorCode.
errorCode Meaning
invalid_source_url Not an absolute https URL, or points at a refused address.
source_unreachable Could not connect.
source_timeout Took longer than 30 s.
source_unavailable The source answered with a non-success status.
source_too_large Over 20 MB.
source_empty Zero bytes.
unsupported_media_type Not PNG, JPEG, GIF or WebP.

fetched counts downloads actually performed — useful for seeing how much deduplication saved.