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

# How-to: Deleting a Position

## When to use this

Use **delete** only when you need to permanently remove a position.

<Warning>
  Deleting is **permanent**. Make sure no teams still rely on this position and that you’ve exported any needed data. **Prefer** [**Archiving a position**](/features/positions/archiving-position) to stop new invites while keeping past interviews.
</Warning>

## GraphQL Request

Please make sure to replace the position ID. Reminder: Deleting a position deletes all data related to it, including all interviews. Don't forget to update the [Hireflix API Key](/quickstart) in the `headers`.

<iframe src="https://cdn.hireflix.com/graphql-playground/index.html?query=DeletePosition&url=https://api.hireflix.com/me" width="100%" height="750" />

### Explanation

* **input.positionId** – the position you want to remove.
* **deletePosition (union)** – returns one of two possible types. Check `__typename` to determine which one you got:
  * `MutationDeletePositionSuccess`: the deletion succeeded. Data returns a boolean-like result (implementation dependent).
  * `PositionNotFoundError`: the position couldn't be found. Code and message describe the error.

<Info>
  Treat any GraphQL `errors`, as well as a `PositionNotFoundError` response, as a failed delete.
</Info>

### Example Response

```json theme={null}
{
  "data": {
    "deletePosition": {
      "data": true
    }
  }
}
```

If the deletion fails — for example, if the position doesn't exist — you'll get an error response instead:

```json theme={null}
{
  "data": {
    "deletePosition": {
      "__typename": "PositionNotFoundError",
      "code": 404,
      "message": "Position not found: 68d53cf0a3d3c03c50f103c3"
    }
  }
}
```

<Card title="Learn next?" icon="arrow-right" color="#5863ff" horizontal href="/webhooks/getting-started">
  Let's learn how to create and use webhooks.
</Card>
