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

# Unassign Pilots

> Remove one or more pilots from a job.

Requires an API key with `full_access` scope.

Removes pilot assignments from all occurrences of a job.

## Path parameters

<ParamField path="projectId" type="string" required>
  The unique identifier of the project.
</ParamField>

<ParamField path="jobId" type="string" required>
  The unique identifier of the job.
</ParamField>

## Body

<ParamField body="pilots" type="string[]" required>
  Array of user IDs to unassign. Must contain at least one pilot ID.
</ParamField>

## Response

<ResponseField name="message" type="string">
  Confirmation message.
</ResponseField>

<ResponseField name="pilots_removed" type="string[]">
  IDs of pilots that were unassigned.
</ResponseField>

<ResponseField name="assignments_removed" type="number">
  Total number of assignment records removed.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.dronebundle.com/v1/projects/01964c6b-7a3e-7f00-8000-abc123def456/jobs/019d4350-a1b2-7c3d-8e4f-567890abcdef/unassign \
    -H "Authorization: Bearer v1_your_api_key_here" \
    -H "Content-Type: application/json" \
    -d '{
      "pilots": ["03144892-6021-705a-08f2-8e147cff3f28"]
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "message": "Selected pilots unassigned successfully",
    "pilots_removed": ["03144892-6021-705a-08f2-8e147cff3f28"],
    "assignments_removed": 5
  }
  ```
</ResponseExample>

## Errors

**400 Bad Request** - Invalid request.

```json theme={null}
{
  "message": "pilots array is required and must contain at least one pilot ID"
}
```

**404 Not Found** - Job not found or no assignments exist.

```json theme={null}
{
  "message": "No pilot assignments found for this job"
}
```
