> ## Documentation Index
> Fetch the complete documentation index at: https://alliancebioversityciat-alliance-risk-analysis-tool.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Job Status

Polls the status of an asynchronous background job (e.g. AI preview via Bedrock). Returns the job record including status and result payload.

## Authentication

Requires JWT Bearer token (Cognito). Jobs are scoped to the requesting user — you cannot access other users' jobs.

## Path Parameters

**id** `string` *required*

Job UUID returned from the job-creating endpoint (e.g. POST /api/admin/prompts/preview)

**Format:** UUID

**Example:** `550e8400-e29b-41d4-a716-446655440000`

## Response

**id** `string`

Job UUID

**type** `string`

Job type enum value

**Values:** `AI_PREVIEW`, `PARSE_DOCUMENT`, `GAP_DETECTION`, `RISK_ANALYSIS`, `REPORT_GENERATION`

**status** `string`

Current job status

**Values:** `PENDING`, `PROCESSING`, `COMPLETED`, `FAILED`

**Poll every 3 seconds** until status is `COMPLETED` or `FAILED`

**result** `object`

Output from the worker Lambda when status is `COMPLETED`. Structure varies by job type.

For `AI_PREVIEW` jobs:

* `output` (string): The AI-generated preview text

**error** `string`

Error message if status is `FAILED`

**attempts** `number`

Number of processing attempts (max 3 retries)

**createdAt** `string`

ISO 8601 timestamp when the job was created

**startedAt** `string`

ISO 8601 timestamp when processing started

**completedAt** `string`

ISO 8601 timestamp when the job completed or failed

**updatedAt** `string`

ISO 8601 timestamp of last status update

## Example Request

```bash theme={null}
curl -X GET https://api.example.com/api/jobs/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
```

## Example Response (Completed)

```json theme={null}
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "type": "AI_PREVIEW",
  "status": "COMPLETED",
  "result": {
    "output": "The main market risks identified are price volatility, lack of market access, and limited contract farming opportunities. Recommendations include establishing farmer cooperatives, diversifying market channels, and implementing price risk management strategies."
  },
  "error": null,
  "attempts": 1,
  "createdAt": "2026-03-04T12:00:00.000Z",
  "startedAt": "2026-03-04T12:00:01.000Z",
  "completedAt": "2026-03-04T12:00:05.000Z",
  "updatedAt": "2026-03-04T12:00:05.000Z"
}
```

## Example Response (Processing)

```json theme={null}
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "type": "AI_PREVIEW",
  "status": "PROCESSING",
  "result": null,
  "error": null,
  "attempts": 1,
  "createdAt": "2026-03-04T12:00:00.000Z",
  "startedAt": "2026-03-04T12:00:01.000Z",
  "completedAt": null,
  "updatedAt": "2026-03-04T12:00:02.000Z"
}
```

## Example Response (Failed)

```json theme={null}
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "type": "AI_PREVIEW",
  "status": "FAILED",
  "result": null,
  "error": "Bedrock API error: ThrottlingException - Rate exceeded",
  "attempts": 3,
  "createdAt": "2026-03-04T12:00:00.000Z",
  "startedAt": "2026-03-04T12:00:01.000Z",
  "completedAt": "2026-03-04T12:00:15.000Z",
  "updatedAt": "2026-03-04T12:00:15.000Z"
}
```

## Error Responses

**400** `error`

Invalid UUID format

**401** `error`

Missing or invalid Bearer token

**404** `error`

Job not found or does not belong to the requesting user

## Source Code

Implementation: `packages/api/src/jobs/jobs.controller.ts:19`


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