> ## Documentation Index
> Fetch the complete documentation index at: https://docs.submagic.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Iris Job

> Read Iris's answer to a message

# Get Iris Job

Read the job a [Message Iris](https://docs.submagic.co/api-reference/iris-message.md) 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**: `version` is the new version and `reply` says what she changed. To get the video file, call [Export Project](https://docs.submagic.co/api-reference/export-project.md): it renders Iris's latest version.
* **Asked a question**: `question` holds it, with the answers she offers. Send your answer with another [Message Iris](https://docs.submagic.co/api-reference/iris-message.md) call.
* **Changed nothing**: `version` and `question` are `null`. `reply`, when set, says why.

> [!NOTE]
>
> This endpoint requires authentication and has a rate limit of 1000 requests
> per hour. It does not use credits.

## Authentication

**x-api-key** `string` *required*

Your Submagic API key starting with `sk-`

## Path Parameters

**id** `string` *required*

The unique identifier (UUID) of the project

**jobId** `string` *required*

The `jobId` returned by [Message Iris](https://docs.submagic.co/api-reference/iris-message.md)

## Response

**projectId** `string`

The project's ID

**jobId** `string`

The job's ID

**status** `string`

`running`, `done` or `error`

**version** `number | null`

The edit's new version, or `null` when nothing changed (yet)

**reply** `string | null`

What Iris says she did, in plain words

**question** `object | null`

Iris's question back, when she needs an answer

**Question Object**

**text** `string`

The question

**options** `string[]`

The answers she offers

**error** `string | null`

Why Iris could not do it, when `status` is `error`

```bash cURL theme={null}
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"
```

```javascript JavaScript theme={null}
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"
);
```

```python Python theme={null}
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'
)
```

```json 200 OK - Edit Changed theme={null}
{
  "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
}
```

```json 200 OK - Question Back theme={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
}
```

```json 200 OK - Still Working theme={null}
{
  "projectId": "11111111-1111-4111-8111-111111111111",
  "jobId": "22222222-2222-4222-8222-222222222222",
  "status": "running",
  "version": null,
  "reply": null,
  "question": null,
  "error": null
}
```

```json 404 NOT_FOUND theme={null}
{
  "error": "NOT_FOUND",
  "message": "No such Iris job on this project",
  "reason": "not_found"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.