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

# Create a job

> Starts building a job from its description, on the workflow you name or your company's default workflow. Generation runs after the response, so this returns `202` with `generation_status: pending`. Poll `GET /jobs/{id}` until `generation_status` is `complete` or `failed`. Emits `job.created` once the job exists.

## Waiting for the job

The response is `202` with `generation_status: "pending"`. Poll the job until generation finishes:

```bash theme={null}
curl "https://api.alex.com/v2/jobs/8b1f0c52-3e4a-4d8e-9a77-2f6c1d0b9e31" \
  -H "X-API-Key: $ALEX_API_KEY"
```

* `complete`: the job is ready. Invite candidates to it.
* `failed`: generation stopped. `failure_reason` says why. Fix the request and create the job again.

While a job is `pending`, `GET /jobs` doesn't list it and `PATCH /jobs/{id}` returns `409` `job_generating`. `DELETE /jobs/{id}` cancels it.


## API Specification

The full API specification for this endpoint is available in the [documentation index](https://docs.alex.com/llms.txt).


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