# Check whether jobs are still open

`POST https://trawle.com/v1/jobs/status`

Bulk status for up to 100 job ids from earlier results: `open`, `closed` (with `closedAt`) or `not_found`. Use it to drop closed jobs from a list you are tracking, instead of fetching each job. Data refreshes once a day.

## Request body

`application/json`, required (CheckJobStatusRequest)

- `ids` (array<string>, required): Job ids from earlier search results (`jobs[].id`), up to 100. 1 to 100 items, items: 1 to 20 characters. Example: `["1234567","1234568"]`.

## Responses

### 200: One status per id.

Schema: CheckJobStatusResult

- `items` (array<object>, required, JobStatus): One item per distinct id asked for, in the order given.
  - `id` (string, required): Example: `1234567`.
  - `status` (string, required): `open`: still on the employer's site at the last daily scan. `closed`: gone from it. `not_found`: not a Trawle job id (or archived long ago); treat it as closed. One of: `open`, `closed`, `not_found`.
  - `closedAt` (string<date-time> | null, required): When it disappeared; null unless closed. Example: `2026-10-31T06:12:00.000Z`.
  - `lastSeenAt` (string<date-time> | null, required): Last daily scan that saw it open; null when not found. Example: `2026-10-31T06:12:00.000Z`.

### 400: Invalid request: see `error.issues` and `error.hint`.

Schema: Error

- `error` (object, required)
  - `code` (string, required): Machine-readable: `invalid_request`, `not_found`, `forbidden`, `rate_limited`, `internal`. Example: `invalid_request`.
  - `message` (string, required): Example: `places: expected an array of GeoNames ids`.
  - `hint` (string, optional): What to do next, e.g. which lookup to call first. Example: `Resolve place names to ids with GET /v1/places?q=`.
  - `issues` (array<object>, optional): Validation problems, one per invalid field.
    - `path` (string, required)
    - `message` (string, required)

## Examples

### cURL

```bash
curl -X POST "https://trawle.com/v1/jobs/status" \
  -H "Content-Type: application/json" \
  -d '{
  "ids": ["1234567", "1234568"]
}'
```

### TypeScript

```ts
import createClient from "openapi-fetch";

// npx openapi-typescript https://developers.trawle.com/openapi.json -o trawle.d.ts
import type { paths } from "./trawle";

const trawle = createClient<paths>({ baseUrl: "https://trawle.com" });

const { data, error } = await trawle.POST("/v1/jobs/status", {
  body: {
    ids: ["1234567", "1234568"],
  },
});
```

### Python

```python
import requests

response = requests.post(
    "https://trawle.com/v1/jobs/status",
    json={
        "ids": ["1234567", "1234568"],
    },
)
response.raise_for_status()
data = response.json()
```

### Response 200

```json
{
  "items": [
    {
      "id": "1234567",
      "status": "open",
      "closedAt": "2026-10-31T06:12:00.000Z",
      "lastSeenAt": "2026-10-31T06:12:00.000Z"
    }
  ]
}
```

### Response 400

```json
{
  "error": {
    "code": "invalid_request",
    "message": "query.places.0: Invalid input: expected number, received string",
    "hint": "Fix the fields in `issues`. Ids for `places`, `roles` and `companies` come from the lookup endpoints.",
    "issues": [
      {
        "path": "query.places.0",
        "message": "Invalid input: expected number, received string"
      }
    ]
  }
}
```
