curl -X GET "https://api.submagic.co/v1/projects/11111111-1111-4111-8111-111111111111/iris/jobs/22222222-2222-4222-8222-222222222222" \
-H "x-api-key: sk-your-api-key-here"
const waitForIris = async (projectId, jobId) => {
for (;;) {
const response = await fetch(
`https://api.submagic.co/v1/projects/${projectId}/iris/jobs/${jobId}`,
{
headers: {
"x-api-key": "sk-your-api-key-here",
},
}
);
const job = await response.json();
if (job.status !== "running") return job;
await new Promise((resolve) => setTimeout(resolve, 5000));
}
};
const job = await waitForIris(
"11111111-1111-4111-8111-111111111111",
"22222222-2222-4222-8222-222222222222"
);
import time
import requests
def wait_for_iris(project_id, job_id):
url = f'https://api.submagic.co/v1/projects/{project_id}/iris/jobs/{job_id}'
headers = {
'x-api-key': 'sk-your-api-key-here'
}
while True:
job = requests.get(url, headers=headers).json()
if job.get('status') != 'running':
return job
time.sleep(5)
job = wait_for_iris(
'11111111-1111-4111-8111-111111111111',
'22222222-2222-4222-8222-222222222222'
)
{
"projectId": "11111111-1111-4111-8111-111111111111",
"jobId": "22222222-2222-4222-8222-222222222222",
"status": "done",
"version": 3,
"reply": "I lowered the music under your voice.",
"question": null,
"error": null
}
{
"projectId": "11111111-1111-4111-8111-111111111111",
"jobId": "22222222-2222-4222-8222-222222222222",
"status": "done",
"version": null,
"reply": null,
"question": {
"text": "Which part should get the city b-roll?",
"options": ["The intro", "When I mention New York"]
},
"error": null
}
{
"projectId": "11111111-1111-4111-8111-111111111111",
"jobId": "22222222-2222-4222-8222-222222222222",
"status": "running",
"version": null,
"reply": null,
"question": null,
"error": null
}
{
"error": "NOT_FOUND",
"message": "No such Iris job on this project",
"reason": "not_found"
}
API Reference
Get Iris Job
Read Iris’s answer to a message
GET
/
v1
/
projects
/
{id}
/
iris
/
jobs
/
{jobId}
curl -X GET "https://api.submagic.co/v1/projects/11111111-1111-4111-8111-111111111111/iris/jobs/22222222-2222-4222-8222-222222222222" \
-H "x-api-key: sk-your-api-key-here"
const waitForIris = async (projectId, jobId) => {
for (;;) {
const response = await fetch(
`https://api.submagic.co/v1/projects/${projectId}/iris/jobs/${jobId}`,
{
headers: {
"x-api-key": "sk-your-api-key-here",
},
}
);
const job = await response.json();
if (job.status !== "running") return job;
await new Promise((resolve) => setTimeout(resolve, 5000));
}
};
const job = await waitForIris(
"11111111-1111-4111-8111-111111111111",
"22222222-2222-4222-8222-222222222222"
);
import time
import requests
def wait_for_iris(project_id, job_id):
url = f'https://api.submagic.co/v1/projects/{project_id}/iris/jobs/{job_id}'
headers = {
'x-api-key': 'sk-your-api-key-here'
}
while True:
job = requests.get(url, headers=headers).json()
if job.get('status') != 'running':
return job
time.sleep(5)
job = wait_for_iris(
'11111111-1111-4111-8111-111111111111',
'22222222-2222-4222-8222-222222222222'
)
{
"projectId": "11111111-1111-4111-8111-111111111111",
"jobId": "22222222-2222-4222-8222-222222222222",
"status": "done",
"version": 3,
"reply": "I lowered the music under your voice.",
"question": null,
"error": null
}
{
"projectId": "11111111-1111-4111-8111-111111111111",
"jobId": "22222222-2222-4222-8222-222222222222",
"status": "done",
"version": null,
"reply": null,
"question": {
"text": "Which part should get the city b-roll?",
"options": ["The intro", "When I mention New York"]
},
"error": null
}
{
"projectId": "11111111-1111-4111-8111-111111111111",
"jobId": "22222222-2222-4222-8222-222222222222",
"status": "running",
"version": null,
"reply": null,
"question": null,
"error": null
}
{
"error": "NOT_FOUND",
"message": "No such Iris job on this project",
"reason": "not_found"
}
Get Iris Job
Read the job a Message Iris call started. While Iris works,status is running. An answer takes from a few seconds (a question back) to a few minutes (new b-roll, a re-cut), so read the job again every few seconds until status is done or error.
When the job is done, Iris did one of three things:
- Changed the edit:
versionis the new version andreplysays what she changed. To get the video file, call Export Project: it renders Iris’s latest version. - Asked a question:
questionholds it, with the answers she offers. Send your answer with another Message Iris call. - Changed nothing:
versionandquestionarenull.reply, when set, says why.
This endpoint requires authentication and has a rate limit of 1000 requests
per hour. It does not use credits.
Authentication
Path Parameters
The
jobId returned by Message IrisResponse
curl -X GET "https://api.submagic.co/v1/projects/11111111-1111-4111-8111-111111111111/iris/jobs/22222222-2222-4222-8222-222222222222" \
-H "x-api-key: sk-your-api-key-here"
const waitForIris = async (projectId, jobId) => {
for (;;) {
const response = await fetch(
`https://api.submagic.co/v1/projects/${projectId}/iris/jobs/${jobId}`,
{
headers: {
"x-api-key": "sk-your-api-key-here",
},
}
);
const job = await response.json();
if (job.status !== "running") return job;
await new Promise((resolve) => setTimeout(resolve, 5000));
}
};
const job = await waitForIris(
"11111111-1111-4111-8111-111111111111",
"22222222-2222-4222-8222-222222222222"
);
import time
import requests
def wait_for_iris(project_id, job_id):
url = f'https://api.submagic.co/v1/projects/{project_id}/iris/jobs/{job_id}'
headers = {
'x-api-key': 'sk-your-api-key-here'
}
while True:
job = requests.get(url, headers=headers).json()
if job.get('status') != 'running':
return job
time.sleep(5)
job = wait_for_iris(
'11111111-1111-4111-8111-111111111111',
'22222222-2222-4222-8222-222222222222'
)
{
"projectId": "11111111-1111-4111-8111-111111111111",
"jobId": "22222222-2222-4222-8222-222222222222",
"status": "done",
"version": 3,
"reply": "I lowered the music under your voice.",
"question": null,
"error": null
}
{
"projectId": "11111111-1111-4111-8111-111111111111",
"jobId": "22222222-2222-4222-8222-222222222222",
"status": "done",
"version": null,
"reply": null,
"question": {
"text": "Which part should get the city b-roll?",
"options": ["The intro", "When I mention New York"]
},
"error": null
}
{
"projectId": "11111111-1111-4111-8111-111111111111",
"jobId": "22222222-2222-4222-8222-222222222222",
"status": "running",
"version": null,
"reply": null,
"question": null,
"error": null
}
{
"error": "NOT_FOUND",
"message": "No such Iris job on this project",
"reason": "not_found"
}

