---
title: "Get a generation run"
method: GET
path: "/ai-context/generate/{job_id}/"
tags: ["ai-context"]
---

# Get a generation run

`GET /ai-context/generate/{job_id}/`

## Request

- Base URL: `https://api.getoneprofile.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.getoneprofile.ai/ai-context/generate/{job_id}/`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

Poll a generation run until its status is terminal. On success the AI context record has already been overwritten with the generated fields.

## Path parameters

- `job_id` string, uuid, required

## Response `200`

Successful Response

- AiContextGenerationJobReadSchema: A generation job's current state. Poll this until `status` is terminal.
  - `created_at` string, date-time, required
  - `domain` string, required: The domain this job is researching.
  - `error` string, nullable, required: Why generation failed: infra trouble, or too little public content.
  - `id` string, uuid, required
  - `status` 'pending' | 'running' | 'succeeded' | 'failed', required: Where a context-generation job has got to. Jobs are born ``RUNNING``: creation validates, inserts and queues the workflow in one call, so there is no separate committed-but-not-started phase. ``PENDING`` exists for schema parity with the other job enums and is never observed. The two terminal states are absorbing: a job never leaves them.
  - `steps` AiStep[]: What the research did, one step per piece of work once it is done: the documents and pages it read, the sections it wrote. Grows while the job runs; kept once it finishes.
    - `action` string, required: What kind of move this was, e.g. `read_table`, `plan`, `write_column`.
    - `detail` string: The step's input: the instruction, the column it read, the query it ran.
    - `duration_ms` integer, nullable: Wall clock for the work this step describes, never an estimate.
    - `observation` string: One line on what came back. The half that makes a step worth reading.
    - `outcome` string: `completed`, `failed`, `refused` or `stopped`. Clients must tolerate new tokens.
    - `thought` string, nullable: The model's stated reasoning for choosing this step. Set by the agent loop; the assistant surfaces leave it null, and the renderer simply omits the rung.
  - `updated_at` string, date-time, required

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `404`: Run not found
- `422`: Invalid request made to the API.
- `500`: Internal server error.
- `502`: Bad gateway error.
- `503`: Service unavailable.

---

[API](https://skmtc.dev/getoneprofile/apis/api-reference-oneprofile.md) · [All operations](https://skmtc.dev/getoneprofile/apis/api-reference-oneprofile/llms.txt) · [OpenAPI document](https://skmtc.dev/getoneprofile/apis/api-reference-oneprofile/revisions/4a6bd71e3f02?raw)
