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

# Create Application

> Create a new application for a candidate in a hiring flow

## Create Application

Sign up a candidate for an application by providing their email, phone number, name, and hiring flow ID.

### Endpoint

```
POST /external/v1/application/create/
```

### Authentication

> \[!NOTE]
> Requires a valid company API key in the `Authorization` header (format: `Api-Key <key>`).

### Request Body

| Field            | Type          | Required | Description                                                                   |
| ---------------- | ------------- | -------- | ----------------------------------------------------------------------------- |
| `email`          | string        | Yes      | The email address of the user                                                 |
| `hiring_flow_id` | string (UUID) | Yes      | The ID of the hiring flow                                                     |
| `phone_number`   | string        | Yes      | The phone number of the user                                                  |
| `name`           | string        | No       | Full name of the user (optional if `first_name` and `last_name` are provided) |
| `first_name`     | string        | No       | First name of the user (optional if `name` is provided)                       |
| `last_name`      | string        | No       | Last name of the user (optional if `name` is provided)                        |

### Example Request

```bash theme={null}
curl -X POST "https://api.firstwork.com/external/v1/application/create/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "hiring_flow_id": "550e8400-e29b-41d4-a716-446655440000",
    "email": "john.doe@example.com",
    "phone_number": "+1234567890",
    "first_name": "John",
    "last_name": "Doe"
  }'
```

### Responses

#### 201: Created

Successfully signed up for the application. Returns the application object.

#### 400: Bad Request

Invalid request body, missing required fields, or invalid hiring flow ID.

### Notes

* If the candidate email already exists in the system, the application is linked to the existing user
* If the candidate is new, a user account is automatically created
* The application starts at the first stage of the hiring flow
* Any configured automations for the first stage will trigger
