# applications API

> Operations under /api/v1/applications. GET /api/v1/applications, POST /api/v1/applications, GET /api/v1/applications/{id}, PATCH /api/v1/applications/{id}.

4 operations. Each needs an API key with the permission shown; see [API keys and permissions](https://staffedly.com/docs/developers/api-keys).

| Operation | Permission |
| --- | --- |
| [`GET /api/v1/applications`](#get-api-v1-applications) | `recruiting:read` |
| [`POST /api/v1/applications`](#post-api-v1-applications) | `recruiting:write` |
| [`GET /api/v1/applications/{id}`](#get-api-v1-applications-id) | `recruiting:read` |
| [`PATCH /api/v1/applications/{id}`](#patch-api-v1-applications-id) | `recruiting:write` |

## GET /api/v1/applications

Applications: the candidate's name, email and phone, the job, the stage and where they came from. Never résumés, screening chats, scorecards or self-identification answers.

- **Permission:** `recruiting:read`
- **Returns:** a page of records: `{ data, hasMore, nextCursor }`, status 200

**Query parameters** (all optional)

| Name | Description |
| --- | --- |
| `stage` | applied, screening, interview, offer, onboarding, ready, working, pool, withdrawn or declined. Several may be given, comma-separated. |
| `jobId` | Applications for one job. |
| `limit` | Rows per page, 1 to 200. Default 50. |
| `cursor` | The nextCursor value from the previous page. |

**Fields in each record:** `id`, `jobId`, `jobTitle`, `stage`, `source`, `stageAt`, `createdAt`, `onboardingId`, `candidate`

```bash
curl "https://app.staffedly.com/api/v1/applications?limit=50" \
  -H "Authorization: Bearer $STAFFEDLY_API_KEY"
```

## POST /api/v1/applications

Add an applicant from another system. They appear in the pipeline at Applied with the source "Your other software (API)". The same person cannot have two open applications for the same job.

- **Permission:** `recruiting:write`
- **Returns:** one record: `{ data }`, status 201
- **Safe retry:** send an `Idempotency-Key` header (8 to 128 characters); the same key with the same request returns the first answer again

**Body fields** (JSON; a field the API does not know is refused)

| Field | Description |
| --- | --- |
| `name` | Required. Full name. |
| `email` | Required. |
| `phone` | Optional mobile number. |
| `zip` | Optional ZIP code. |
| `jobId` | The job, from /api/v1/jobs. Leave out for a general application. |
| `note` | Optional first line on their timeline. |

**Fields in each record:** `id`, `jobId`, `jobTitle`, `stage`, `source`, `stageAt`, `createdAt`, `onboardingId`, `candidate`

```bash
curl -X POST "https://app.staffedly.com/api/v1/applications" \
  -H "Authorization: Bearer $STAFFEDLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"name":"Jordan Avery","email":"jordan.avery@example.com"}'
```

## GET /api/v1/applications/{id}

One application.

- **Permission:** `recruiting:read`
- **Returns:** one record: `{ data }`, status 200

**Path**

| Name | Description |
| --- | --- |
| `id` | The record's id. |

**Fields in each record:** `id`, `jobId`, `jobTitle`, `stage`, `source`, `stageAt`, `createdAt`, `onboardingId`, `candidate`

```bash
curl "https://app.staffedly.com/api/v1/applications/<id>" \
  -H "Authorization: Bearer $STAFFEDLY_API_KEY"
```

## PATCH /api/v1/applications/{id}

Move an application to applied, screening, interview, offer, pool or withdrawn. Not moving forward and hiring are decided by a person in the app and are refused here.

- **Permission:** `recruiting:write`
- **Returns:** one record: `{ data }`, status 200
- **Safe retry:** send an `Idempotency-Key` header (8 to 128 characters); the same key with the same request returns the first answer again

**Path**

| Name | Description |
| --- | --- |
| `id` | The record's id. |

**Body fields** (JSON; a field the API does not know is refused)

| Field | Description |
| --- | --- |
| `stage` | Required. applied, screening, interview, offer, pool or withdrawn. |
| `note` | Optional note kept on the timeline. |

**Fields in each record:** `id`, `jobId`, `jobTitle`, `stage`, `source`, `stageAt`, `createdAt`, `onboardingId`, `candidate`

```bash
curl -X PATCH "https://app.staffedly.com/api/v1/applications/<id>" \
  -H "Authorization: Bearer $STAFFEDLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"stage":"<stage>"}'
```

