# Status Polling

After uploading a pathology file you receive an `uploadId`. Use the status endpoint to check whether processing has completed and whether your callback was delivered successfully.

## Endpoint

```
GET https://app.jondax.eu/api/v1/status/:uploadId
Authorization: Bearer <JONDAX_API_KEY>
```

Authentication uses your API key (the same one used for uploads) — no session JWT is required.

## Example request

```bash
curl --location 'https://app.jondax.eu/api/v1/status/:uploadId' \
--header 'Authorization: Bearer <JONDAX_API_KEY>'
```

## Response (HTTP 200)

### Status: completed

```json
{
  "success": true,
  "data": {
    "uploadId": "adbd198e-75c5-4a4b-9285-b3debb898091",
    "customerId": 11,
    "transactionId": 478,
    "fileName": "image (3).png",
    "status": "completed",
    "createdAt": "2026-06-03T07:41:10.633Z",
    "completedAt": "2026-06-03T07:58:20.426Z",
    "callbackDelivery": {
      "status": "delivered",
      "attempts": 1,
      "lastAttemptAt": "2026-07-07T01:58:58.446Z"
    },
    "expiresAt": "2026-07-03T07:41:10.633Z"
  }
}
```

### Status: processing

```json
{
  "success": true,
  "data": {
    "uploadId": "adbd198e-75c5-4a4b-9285-b3debb898091",
    "customerId": 11,
    "transactionId": 478,
    "fileName": "image (3).png",
    "status": "processing",
    "createdAt": "2026-05-29T11:36:02.152Z",
    "completedAt": "2026-05-29T12:14:50.708Z",
    "callbackDelivery": {
      "status": "pending",
      "attempts": 0,
      "lastAttemptAt": null
    },
    "expiresAt": "2026-06-28T11:36:02.152Z"
  }
}
```

### Status: uploaded

```json
{
  "success": true,
  "data": {
    "uploadId": "adbd198e-75c5-4a4b-9285-b3debb898091",
    "customerId": 11,
    "transactionId": 478,
    "fileName": "image (3).png",
    "status": "uploaded",
    "createdAt": "2026-05-30T05:18:12.185Z",
    "completedAt": "2026-05-30T05:24:43.555Z",
    "callbackDelivery": {
      "status": "pending",
      "attempts": 0,
      "lastAttemptAt": null
    },
    "expiresAt": "2026-06-29T05:18:12.185Z"
  }
}
```

## Response field reference

| Field | Type | Description |
|  --- | --- | --- |
| `data.uploadId` | string | UUID identifying this upload |
| `data.customerId` | integer | Your account identifier |
| `data.transactionId` | integer | Internal transaction identifier |
| `data.fileName` | string | Original uploaded filename |
| `data.status` | string | Processing status — see values below |
| `data.createdAt` | string | ISO 8601 timestamp when the upload was received |
| `data.completedAt` | string | null | ISO 8601 timestamp when processing finished. `null` if still in progress |
| `data.callbackDelivery.status` | string | Callback delivery status — see values below |
| `data.callbackDelivery.attempts` | integer | Number of delivery attempts made |
| `data.callbackDelivery.lastAttemptAt` | string | null | ISO 8601 timestamp of the last delivery attempt. `null` if not yet attempted |
| `data.expiresAt` | string | ISO 8601 timestamp when this record is purged (30 days after upload) |


### `data.status` values

| Value | Description |
|  --- | --- |
| `uploaded` | File received and queued for processing |
| `processing` | Extraction and transformation in progress |
| `completed` | Processing finished; callback dispatched (delivery may still be in progress) |
| `failed` | Processing failed; error callback sent or pending |
| `expired` | Past the 30-day retention window; data has been purged |


### `data.callbackDelivery.status` values

| Value | Description |
|  --- | --- |
| `pending` | Callback not yet attempted |
| `delivered` | Callback successfully delivered (your endpoint returned 2xx) |
| `retrying` | One or more delivery attempts failed; retries in progress |
| `exhausted` | All 3 retry attempts failed; result stored, contact support to retrieve |


## Polling strategy

Poll every **5–10 seconds** until `data.status` is `completed` or `failed`. Once the status is terminal, stop polling.

```
status = "uploaded" or "processing"  → wait and poll again
status = "completed"                  → check callbackDelivery.status
status = "failed"                     → handle error; check callbackDelivery.status for error callback delivery
status = "expired"                    → upload ID is no longer valid
```

## Data retention

Upload records and results are retained for **30 days** from the upload date. After that, the `uploadId` returns a `404` response and the associated data is permanently purged.