Base URL https://iqcore.ai/api/public/v1. Every request needs Authorization: Bearer iqk_… (authentication); errors follow one envelope.
Media library
GET /media
Files in the account's Media library, newest first: id, name, kind, source, size, duration, created_at, updated_at, and the total. Filter by text in the name or tags, kind, source, collection id (or none) and updated_since; next_cursor gives the next page.
Parameters
qquery string — Text in the file name or tags. max length 100kindquery string — Only this kind (default all). One of:all,image,video,audio.sourcequery string — Only this source (default all). One of:all,upload,generated,edited,reel,product_ref.collectionquery string — A collection id from media_collections_list, or "none" for files in no collection. max length 64limitquery integer — At most this many (default 10). min 1 · max 25updated_sincequery string — Only files changed at or after this time (ISO 8601 with the offset). max length 40cursorquery string — next_cursor of the previous answer: the next (older) page. max length 64organization_idquery string — The organization to act in. Required when the key works in several organizations.
Response 200
totalinteger required — Files matching the filters (all pages). min 0itemsarray of object required max items 25idstring required — The file id (uuid).namestring required — The file name (data: it can come from an upload or a store). max length 120kindstring required — image, video or audio.sourcestring required — upload, generated, edited, reel or product.statusstring — ready; pending while a URL import runs; failed (see error). One of:ready,pending,failed.size_kbinteger required min 0duration_snumber — Seconds (video / audio).created_atstringupdated_atstring
next_cursorstring | null required — Send it as cursor for the next page; null = no more.has_moreboolean required
Errors: 400 401 403 404 422 429 500 — codes
Example
curl "https://iqcore.ai/api/public/v1/media" \
-H "Authorization: Bearer $IQCORE_KEY"const res = await fetch("https://iqcore.ai/api/public/v1/media", {
headers: { Authorization: `Bearer ${process.env.IQCORE_KEY}` },
});
console.log(res.status, await res.json());import os
import requests
res = requests.get(
"https://iqcore.ai/api/public/v1/media",
headers={"Authorization": f"Bearer {os.environ['IQCORE_KEY']}"},
)
print(res.status_code, res.json()){
"total": 1,
"items": [
{
"id": "<id>",
"name": "Summer sale",
"kind": "kind",
"source": "source",
"status": "ready",
"size_kb": 1,
"duration_s": 1.5,
"created_at": "2026-12-05T09:00:00Z",
"updated_at": "2026-12-05T09:00:00Z"
}
],
"next_cursor": "next_cursor",
"has_more": false
}Add a media file
POST /media
Add one file to the Media library. Either upload it as multipart/form-data (the field file, plus optional name, collection, tags): stored at once, status ready. Or send JSON {"url": "https://…"}: downloaded in the background (status pending; poll GET /media/{id} until ready or failed). The type is read from the bytes (JPG, PNG, WebP, GIF pictures; MP4, MOV, WebM videos; MP3, WAV, M4A, AAC, OGG audio) — never from the name or Content-Type; the Media library size limits and the storage of the plan apply. A URL must be public: http on port 80 or https on 443, no IP addresses, no user name or password; private, local and cloud metadata addresses are refused for the URL and every redirect (at most 3). 10 URL imports per minute per organization.
Parameters
Idempotency-Keyheader string — Your own id for this request (1–100 of A–Z a–z 0–9 . _ : -). The same key and request within 24 hours returns the first answer (Idempotent-Replayed: true) instead of acting twice; the same key with another request is refused (422 idempotency_key_reused); while the first one runs, 409 request_in_progress. Refusals before any effect are not stored.
Request body application/json or multipart/form-data
urlstring — A public http(s) URL of the file (standard port, no user name or password). Its query string is used for the download but never stored. min length 8 · max length 2048namestring — The file name in the Media library (default: from the URL or the upload). min length 1 · max length 200collectionstring — A collection id (media_collections_list). max length 64tagsarray of string — Tags (at most 300 characters together). max items 30organization_idstring — An organization id (uuid) of this key.
Response 201
idstring required — The file id (uuid).namestring required — The file name (data: it can come from an upload or a store). max length 120kindstring | null required — image, video or audio; null while a URL import is pending or after it failed.sourcestring required — upload, generated, edited, reel or product.statusstring required — ready; pending while a URL import runs; failed (see error). One of:ready,pending,failed.size_kbinteger required min 0duration_snumber — Seconds (video / audio).created_atstringupdated_atstringsize_bytesinteger min 0duration_msinteger min 0mime_typestringwidthintegerheightintegerhas_audioboolean — A video has sound (the stored flag; absent when unknown).tagsarray of string max items 20collectionobjectidstring requirednamestring required
source_urlstring — For a file imported from a URL: that URL without its query string. max length 300urlstring — The file. API only: a signed link bound to this API key, valid until urls_expire_at (15 to 22.5 minutes); 404 once the key is revoked.thumb_urlstring — The thumbnail (pictures, videos with a poster). API only: a signed link bound to this API key, valid until urls_expire_at (15 to 22.5 minutes); 404 once the key is revoked.poster_urlstring — The poster frame (videos). API only: a signed link bound to this API key, valid until urls_expire_at (15 to 22.5 minutes); 404 once the key is revoked.urls_expire_atstring — When url / thumb_url / poster_url stop working. Read the file again for fresh links.errorobject — status failed: why the import failed.codestring required — e.g. url_not_public, url_unresolvable, too_many_redirects, http_error, timeout, too_large, unsupported_file_type, file_too_large, storage_full, file_rejected.messagestring required
Errors: 400 401 403 404 409 413 422 429 500 — codes
Example
curl -X POST "https://iqcore.ai/api/public/v1/media" \
-H "Authorization: Bearer $IQCORE_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"name": "Summer sale"
}'
# Or upload the file itself (multipart):
curl -X POST "https://iqcore.ai/api/public/v1/media" \
-H "Authorization: Bearer $IQCORE_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-F file=@picture.jpgconst res = await fetch("https://iqcore.ai/api/public/v1/media", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.IQCORE_KEY}`, "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" },
body: JSON.stringify({
"name": "Summer sale"
}),
});
console.log(res.status, await res.json());import os, uuid
import requests
res = requests.post(
"https://iqcore.ai/api/public/v1/media",
headers={"Authorization": f"Bearer {os.environ['IQCORE_KEY']}", "Idempotency-Key": str(uuid.uuid4())},
json={
"name": "Summer sale"
},
)
print(res.status_code, res.json()){
"id": "<id>",
"name": "Summer sale",
"kind": "kind",
"source": "source",
"status": "ready",
"size_kb": 1,
"duration_s": 1.5,
"created_at": "2026-12-05T09:00:00Z",
"updated_at": "2026-12-05T09:00:00Z",
"size_bytes": 1,
"duration_ms": 1,
"mime_type": "mime_type",
"width": 1,
"height": 1,
"has_audio": false,
"tags": [
"tag"
],
"collection": {
"id": "<id>",
"name": "Summer sale"
},
"source_url": "https://example.com/page",
"url": "https://example.com/picture.jpg",
"thumb_url": "https://example.com/page",
"poster_url": "https://example.com/page",
"urls_expire_at": "2026-12-05T09:00:00Z",
"error": {
"code": "code",
"message": "message"
}
}Media collections
GET /media/collections
The collections (folders) of the account's Media library: id, name, kind (custom, or generated by the platform) and number of files, plus the number of files in no collection.
Parameters
organization_idquery string — The organization to act in. Required when the key works in several organizations.
Response 200
collectionsarray of object required max items 50idstring required — The collection id.namestring requiredkindstring required — custom (made by the team) or generated (kept by the platform).filesinteger required — Files in this collection. min 0
moreboolean — Present (true) when the account has more collections than listed.uncategorisedinteger required — Files in no collection. min 0
Errors: 400 401 403 404 422 429 500 — codes
Example
curl "https://iqcore.ai/api/public/v1/media/collections" \
-H "Authorization: Bearer $IQCORE_KEY"const res = await fetch("https://iqcore.ai/api/public/v1/media/collections", {
headers: { Authorization: `Bearer ${process.env.IQCORE_KEY}` },
});
console.log(res.status, await res.json());import os
import requests
res = requests.get(
"https://iqcore.ai/api/public/v1/media/collections",
headers={"Authorization": f"Bearer {os.environ['IQCORE_KEY']}"},
)
print(res.status_code, res.json()){
"collections": [
{
"id": "<id>",
"name": "Summer sale",
"kind": "kind",
"files": 1
}
],
"more": false,
"uncategorised": 1
}Save a media collection
POST /media/collections
Create a Media library collection (name, optional description), or rename / describe an existing one when the body names its id. The name is unique in the organization. Runs at once.
Parameters
Idempotency-Keyheader string — Your own id for this request (1–100 of A–Z a–z 0–9 . _ : -). The same key and request within 24 hours returns the first answer (Idempotent-Replayed: true) instead of acting twice; the same key with another request is refused (422 idempotency_key_reused); while the first one runs, 409 request_in_progress. Refusals before any effect are not stored.
Request body application/json
idstring — The collection to change; leave out to create a new one. max length 64namestring required min length 1 · max length 120descriptionstring | null max length 500organization_idstring — An organization id (uuid) of this key.
Response 200
idstring required — The collection id (new or changed).messagestring required — A short sentence for a person.
Errors: 400 401 403 404 409 422 429 500 — codes
Example
curl -X POST "https://iqcore.ai/api/public/v1/media/collections" \
-H "Authorization: Bearer $IQCORE_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"name": "Summer sale"
}'const res = await fetch("https://iqcore.ai/api/public/v1/media/collections", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.IQCORE_KEY}`, "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" },
body: JSON.stringify({
"name": "Summer sale"
}),
});
console.log(res.status, await res.json());import os, uuid
import requests
res = requests.post(
"https://iqcore.ai/api/public/v1/media/collections",
headers={"Authorization": f"Bearer {os.environ['IQCORE_KEY']}", "Idempotency-Key": str(uuid.uuid4())},
json={
"name": "Summer sale"
},
)
print(res.status_code, res.json()){
"id": "<id>",
"message": "message"
}Delete files
POST /media/delete
Delete Media library files for good (ids from media_list, at most 50). Cannot be undone. Runs at once; the owner or an admin only.
Parameters
Idempotency-Keyheader string — Your own id for this request (1–100 of A–Z a–z 0–9 . _ : -). The same key and request within 24 hours returns the first answer (Idempotent-Replayed: true) instead of acting twice; the same key with another request is refused (422 idempotency_key_reused); while the first one runs, 409 request_in_progress. Refusals before any effect are not stored.
Request body application/json
idsarray of string required — File ids. min items 1 · max items 50organization_idstring — An organization id (uuid) of this key.
Response 200
deletedinteger required — How many files were deleted. min 0messagestring required
Errors: 400 401 403 404 409 422 429 500 — codes
Example
curl -X POST "https://iqcore.ai/api/public/v1/media/delete" \
-H "Authorization: Bearer $IQCORE_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"ids": [
"<id>"
]
}'const res = await fetch("https://iqcore.ai/api/public/v1/media/delete", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.IQCORE_KEY}`, "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" },
body: JSON.stringify({
"ids": [
"<id>"
]
}),
});
console.log(res.status, await res.json());import os, uuid
import requests
res = requests.post(
"https://iqcore.ai/api/public/v1/media/delete",
headers={"Authorization": f"Bearer {os.environ['IQCORE_KEY']}", "Idempotency-Key": str(uuid.uuid4())},
json={
"ids": [
"<id>"
]
},
)
print(res.status_code, res.json()){
"deleted": 1,
"message": "message"
}Move files to a collection
POST /media/move
Move Media library files (at most 50 ids) into a collection, or out of every collection with collection null. One unknown id refuses the whole request (404, nothing moves). Runs at once.
Parameters
Idempotency-Keyheader string — Your own id for this request (1–100 of A–Z a–z 0–9 . _ : -). The same key and request within 24 hours returns the first answer (Idempotent-Replayed: true) instead of acting twice; the same key with another request is refused (422 idempotency_key_reused); while the first one runs, 409 request_in_progress. Refusals before any effect are not stored.
Request body application/json
idsarray of string required — File ids. min items 1 · max items 50collectionstring | null required — The collection id, or null for none. max length 64organization_idstring — An organization id (uuid) of this key.
Response 200
movedinteger required — Files moved. min 0messagestring required — A short sentence for a person.
Errors: 400 401 403 404 409 422 429 500 — codes
Example
curl -X POST "https://iqcore.ai/api/public/v1/media/move" \
-H "Authorization: Bearer $IQCORE_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"ids": [
"<id>"
],
"collection": "collection"
}'const res = await fetch("https://iqcore.ai/api/public/v1/media/move", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.IQCORE_KEY}`, "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" },
body: JSON.stringify({
"ids": [
"<id>"
],
"collection": "collection"
}),
});
console.log(res.status, await res.json());import os, uuid
import requests
res = requests.post(
"https://iqcore.ai/api/public/v1/media/move",
headers={"Authorization": f"Bearer {os.environ['IQCORE_KEY']}", "Idempotency-Key": str(uuid.uuid4())},
json={
"ids": [
"<id>"
],
"collection": "collection"
},
)
print(res.status_code, res.json()){
"moved": 1,
"message": "message"
}Media storage
GET /media/usage
The account's media storage: number of library files, MB used (library files plus AI Chat attachments), of which chat MB, the plan's storage limit in MB (null means no limit) and the percentage used.
Parameters
organization_idquery string — The organization to act in. Required when the key works in several organizations.
Response 200
filesinteger required — Media library files. min 0used_mbnumber required — MB used: library files plus AI Chat attachments. min 0chat_mbnumber required — Of which AI Chat attachments. min 0limit_mbnumber | null required — The plan's storage limit in MB; null = no limit.used_percentinteger | null required — Share of the limit used; null without a limit. min 0 · max 100
Errors: 400 401 403 404 422 429 500 — codes
Example
curl "https://iqcore.ai/api/public/v1/media/usage" \
-H "Authorization: Bearer $IQCORE_KEY"const res = await fetch("https://iqcore.ai/api/public/v1/media/usage", {
headers: { Authorization: `Bearer ${process.env.IQCORE_KEY}` },
});
console.log(res.status, await res.json());import os
import requests
res = requests.get(
"https://iqcore.ai/api/public/v1/media/usage",
headers={"Authorization": f"Bearer {os.environ['IQCORE_KEY']}"},
)
print(res.status_code, res.json()){
"files": 1,
"used_mb": 1.5,
"chat_mb": 1.5,
"limit_mb": 1.5,
"used_percent": 1
}Media file
GET /media/{id}
One Media library file by its id: name, kind, source, status (ready; pending while a URL import runs; failed with error {code, message}), file type, size, width and height, duration, sound, tags, collection, created_at, and signed links to the file, its thumbnail and poster (url, thumb_url, poster_url — bound to this API key, valid until urls_expire_at). Poll it after POST /media with a url until status is ready or failed.
Parameters
idpath string required — The file id (uuid). max length 64organization_idquery string — The organization to act in. Required when the key works in several organizations.
Response 200
idstring required — The file id (uuid).namestring required — The file name (data: it can come from an upload or a store). max length 120kindstring | null required — image, video or audio; null while a URL import is pending or after it failed.sourcestring required — upload, generated, edited, reel or product.statusstring required — ready; pending while a URL import runs; failed (see error). One of:ready,pending,failed.size_kbinteger required min 0duration_snumber — Seconds (video / audio).created_atstringupdated_atstringsize_bytesinteger min 0duration_msinteger min 0mime_typestringwidthintegerheightintegerhas_audioboolean — A video has sound (the stored flag; absent when unknown).tagsarray of string max items 20collectionobjectidstring requirednamestring required
source_urlstring — For a file imported from a URL: that URL without its query string. max length 300urlstring — The file. API only: a signed link bound to this API key, valid until urls_expire_at (15 to 22.5 minutes); 404 once the key is revoked.thumb_urlstring — The thumbnail (pictures, videos with a poster). API only: a signed link bound to this API key, valid until urls_expire_at (15 to 22.5 minutes); 404 once the key is revoked.poster_urlstring — The poster frame (videos). API only: a signed link bound to this API key, valid until urls_expire_at (15 to 22.5 minutes); 404 once the key is revoked.urls_expire_atstring — When url / thumb_url / poster_url stop working. Read the file again for fresh links.errorobject — status failed: why the import failed.codestring required — e.g. url_not_public, url_unresolvable, too_many_redirects, http_error, timeout, too_large, unsupported_file_type, file_too_large, storage_full, file_rejected.messagestring required
Errors: 400 401 403 404 422 429 500 — codes
Example
curl "https://iqcore.ai/api/public/v1/media/<id>" \
-H "Authorization: Bearer $IQCORE_KEY"const res = await fetch("https://iqcore.ai/api/public/v1/media/<id>", {
headers: { Authorization: `Bearer ${process.env.IQCORE_KEY}` },
});
console.log(res.status, await res.json());import os
import requests
res = requests.get(
"https://iqcore.ai/api/public/v1/media/<id>",
headers={"Authorization": f"Bearer {os.environ['IQCORE_KEY']}"},
)
print(res.status_code, res.json()){
"id": "<id>",
"name": "Summer sale",
"kind": "kind",
"source": "source",
"status": "ready",
"size_kb": 1,
"duration_s": 1.5,
"created_at": "2026-12-05T09:00:00Z",
"updated_at": "2026-12-05T09:00:00Z",
"size_bytes": 1,
"duration_ms": 1,
"mime_type": "mime_type",
"width": 1,
"height": 1,
"has_audio": false,
"tags": [
"tag"
],
"collection": {
"id": "<id>",
"name": "Summer sale"
},
"source_url": "https://example.com/page",
"url": "https://example.com/picture.jpg",
"thumb_url": "https://example.com/page",
"poster_url": "https://example.com/page",
"urls_expire_at": "2026-12-05T09:00:00Z",
"error": {
"code": "code",
"message": "message"
}
}Rename or tag a file
PATCH /media/{id}
Change one Media library file: its name, its tags (replaces the list) and / or its collection (a collection id, or null for none). What is left out keeps its value. Runs at once.
Parameters
idpath string required — The file id. max length 64Idempotency-Keyheader string — Your own id for this request (1–100 of A–Z a–z 0–9 . _ : -). The same key and request within 24 hours returns the first answer (Idempotent-Replayed: true) instead of acting twice; the same key with another request is refused (422 idempotency_key_reused); while the first one runs, 409 request_in_progress. Refusals before any effect are not stored.
Request body application/json
namestring min length 1 · max length 200tagsarray of string max items 30collectionstring | null — A collection id, or null for none. max length 64organization_idstring — An organization id (uuid) of this key.
Response 200
idstring required — The file id.messagestring required — A short sentence for a person.
Errors: 400 401 403 404 409 422 429 500 — codes
Example
curl -X PATCH "https://iqcore.ai/api/public/v1/media/<id>" \
-H "Authorization: Bearer $IQCORE_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"name": "Summer sale"
}'const res = await fetch("https://iqcore.ai/api/public/v1/media/<id>", {
method: "PATCH",
headers: { Authorization: `Bearer ${process.env.IQCORE_KEY}`, "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" },
body: JSON.stringify({
"name": "Summer sale"
}),
});
console.log(res.status, await res.json());import os, uuid
import requests
res = requests.patch(
"https://iqcore.ai/api/public/v1/media/<id>",
headers={"Authorization": f"Bearer {os.environ['IQCORE_KEY']}", "Idempotency-Key": str(uuid.uuid4())},
json={
"name": "Summer sale"
},
)
print(res.status_code, res.json()){
"id": "<id>",
"message": "message"
}Check a file for a platform
GET /media/{id}/validate
Check one Media library file (id from media_list) against a platform's media rules for a post format before posting: instagram, facebook, threads or tiktok; format post, reel or carousel (default: reel for a video, post for a picture). Returns ok (no errors), checks with code, severity (error or warning) and message, the rules used and the facts read from the file (size, pixels, length, codecs, frame rate, bit rate). Changes nothing.
Parameters
idpath string required — The file id (uuid). max length 64platformquery string required — The platform to check for. One of:instagram,facebook,threads,tiktok.formatquery string — The post format (default: reel for a video, post for a picture). story is not supported yet (422 unsupported_format). One of:post,reel,carousel,story.organization_idquery string — The organization to act in. Required when the key works in several organizations.
Response 200
media_idstring requiredplatformstring requiredformatstring requiredokboolean required — No check has severity error.checksarray of object required max items 30codestring required — e.g. video_duration, video_codec, video_too_large, video_ratio, image_padded, image_file_too_large, format_mismatch.severitystring required One of:error,warning.messagestring required
specobject | null required — The rules this file was checked against (MediaSpecs).kindsarray of string — The kinds of file this format takes.imageobjectsent_as_isarray of string — Picture types the publisher sends unchanged (others become a fresh JPEG).as_is_max_bytesintegerconverted_tostringmin_widthintegermin_width_actionstringratioarray of number — Width ÷ height, from and to. min items 2 · max items 2ratio_actionstring — padded (made to fit) or refused.
videoobjectcontainersarray of string — File types.video_codecsarray of string — ffprobe codec names.audio_codecsarray of string — ffprobe codec names.fpsarray of number — Frames per second, from and to. min items 2 · max items 2max_widthintegermin_sideintegermax_sideintegerratioarray of number — Width ÷ height, from and to. min items 2 · max items 2duration_msarray of number — Length in milliseconds, from and to. min items 2 · max items 2usual_max_msintegermax_bytesintegermax_bitrateinteger — Bits per second.
factsobject required — What was read from the file (null = unknown).kindstring requiredmime_typestring | nullsize_bytesinteger requiredwidthinteger | nullheightinteger | nullduration_msinteger | nullvideo_codecstring | nullaudio_codecstring | nullfpsnumber | nullbitrateinteger | null
Errors: 400 401 403 404 422 429 500 — codes
Example
curl "https://iqcore.ai/api/public/v1/media/<id>/validate?platform=instagram" \
-H "Authorization: Bearer $IQCORE_KEY"const res = await fetch("https://iqcore.ai/api/public/v1/media/<id>/validate?platform=instagram", {
headers: { Authorization: `Bearer ${process.env.IQCORE_KEY}` },
});
console.log(res.status, await res.json());import os
import requests
res = requests.get(
"https://iqcore.ai/api/public/v1/media/<id>/validate?platform=instagram",
headers={"Authorization": f"Bearer {os.environ['IQCORE_KEY']}"},
)
print(res.status_code, res.json()){
"media_id": "<media_id>",
"platform": "platform",
"format": "format",
"ok": false,
"checks": [
{
"code": "code",
"severity": "error",
"message": "message"
}
],
"spec": {
"kinds": [
"kind"
],
"image": {
"sent_as_is": [
"sent_as_i"
],
"as_is_max_bytes": 1,
"converted_to": "converted_to",
"min_width": 1,
"min_width_action": "min_width_action",
"ratio": [
1.5
],
"ratio_action": "ratio_action"
},
"video": {
"containers": [
"container"
],
"video_codecs": [
"video_codec"
],
"audio_codecs": [
"audio_codec"
],
"fps": [
1.5
],
"max_width": 1,
"min_side": 1,
"max_side": 1,
"ratio": [
1.5
],
"duration_ms": [
1.5
],
"usual_max_ms": 1,
"max_bytes": 1,
"max_bitrate": 1
}
},
"facts": {
"kind": "kind",
"mime_type": "mime_type",
"size_bytes": 1,
"width": 1,
"height": 1,
"duration_ms": 1,
"video_codec": "video_codec",
"audio_codec": "audio_codec",
"fps": 1.5,
"bitrate": 1
}
}