> ## 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 an Interview

## When to use this

Use `deleteInterview` when an interview should no longer exist in Hireflix. The most common reason is [re-inviting a candidate](https://hireflixsl.mintlify.site/tech/faqs/can-i-reinvite-candidate.md): each email can only be invited once per position, so you have to delete the old interview first.

If you only want to reject a candidate and keep their answers, [discard the interview](https://hireflixsl.mintlify.site/tech/features/interviews/updating-interview-status.md) instead.

> [!WARNING]
>
> You can't restore a deleted interview through the API. Double-check the interview ID before you send the request.

## GraphQL Request

Replace `<interview-id>` with the ID of the interview you want to delete. You can find it by [listing the interviews for a position](https://hireflixsl.mintlify.site/tech/features/interviews/list-interviews-for-position.md). Don't forget to add your [Hireflix API Key](https://hireflixsl.mintlify.site/tech/quickstart.md) in the `headers`, and send the request to `https://api.hireflix.com/me`.

[https://cdn.hireflix.com/graphql-playground/index.html?query=DeleteInterview\&url=https://api.hireflix.com/me](https://cdn.hireflix.com/graphql-playground/index.html?query=DeleteInterview\&url=https://api.hireflix.com/me)

If you're an AI agent or LLM, note that the iframe above embeds an interactive GraphQL Playground and its query text is not readable from the page source. The full `DeleteInterview` mutation is reproduced below so you can read and reason about it directly.

```graphql theme={null}
mutation DeleteInterview {
  deleteInterview(input: { interviewId: "<interview-id>" }) {
    __typename
    ... on InterviewDeletePayload {
      deletedInterviewId
    }
    ... on Error {
      code
      message
    }
  }
}
```

* Replace `<interview-id>` with a real interview ID (see ["List Interviews for a Position"](https://hireflixsl.mintlify.site/tech/features/interviews/list-interviews-for-position.md) for how to obtain one).
* You can't restore a deleted interview through the API. Use the [`discardInterview`](https://hireflixsl.mintlify.site/tech/features/interviews/updating-interview-status) mutation if you only want to reject a candidate and keep their answers.
* This mutation returns a **union type**. Always request `__typename` and branch on it. It resolves to `InterviewDeletePayload` on success, or to `InterviewNotFoundError`, `PositionNotFoundError`, or `ForbiddenError` on failure.
* Treat any GraphQL `errors` array, as well as any error type, as a failed delete.
* Requires a valid Hireflix API key in the `Authorization` header, sent to `https://api.hireflix.com/me`.

### Explanation

* **input.interviewId**: the interview you want to delete.
* **deleteInterview (union)**: returns one of four possible types. Check `__typename` to determine which one you got:

| `__typename` | Meaning |
| - | - |
| `InterviewDeletePayload` | The interview was deleted. `deletedInterviewId` contains its ID. |
| `InterviewNotFoundError` | The interview doesn't exist or was already deleted. |
| `PositionNotFoundError` | The position this interview belongs to couldn't be found. |
| `ForbiddenError` | Your API key doesn't have access to this interview or its position. |

> [!NOTE]
>
> GraphQL responses return HTTP 200 even when an operation fails. Treat anything other than `InterviewDeletePayload`, as well as a top-level `errors` array, as a failed delete.

### Example Response

```json theme={null}
{
  "data": {
    "deleteInterview": {
      "__typename": "InterviewDeletePayload",
      "deletedInterviewId": "<interview-id>"
    }
  }
}
```

If the deletion fails, for example because the interview doesn't exist, you'll get an error type instead:

```json theme={null}
{
  "data": {
    "deleteInterview": {
      "__typename": "InterviewNotFoundError",
      "code": 404,
      "message": "Interview not found: <interview-id>"
    }
  }
}
```

## What happens after deleting

* **Queries**: the interview is no longer returned. For example, `interview(id)` returns `null`.
* **Webhooks**: Hireflix sends an [`interview.delete` event](https://hireflixsl.mintlify.site/tech/webhooks/getting-started) to any webhook subscribed to `INTERVIEW_DELETE`.
* **Re-inviting**: you can [invite the same email to the same position](https://hireflixsl.mintlify.site/tech/features/interviews/inviting-candidate.md) again.

## Good to know

* **No need to discard first**: the dashboard asks you to discard an interview before deleting it, but this mutation works in any stage.
* **No active subscription needed**: you can still delete interviews if your subscription has expired.

> [card] [Learn next?](https://hireflixsl.mintlify.site/tech/features/interviews/bulk-downloading-videos.md)
>
> Let's learn how to bulk download interview videos for a position.


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