# Withdraw Invitation

`DELETE /v1/invitations/{invitation_id}`

Withdraw a pending invitation: one to a workspace with ``project_id``,
or with none any in the organization. Needs ``members:write``.

- Base URL: `https://junction-api.qualiastudios.dev`
- Authentication: an API key in the `X-API-Key` header, or `Authorization: Bearer …`

## Parameters

- `invitation_id` (path, string (uuid), required)
- `project_id` (query, string | null (uuid)): A workspace of the organization; omit it for the organization itself. A workspace key names its own workspace.

## Responses

- `200` The invitation, withdrawn: `application/json` `InvitationWithdrawn`
- `400` Refused by the role rules: `application/json` `ErrorResponse`
- `401` Invalid or missing API key: `application/json` `ErrorResponse`
- `403` The key lacks members:write, or its creator may not give or take this role here (nobody grants above their own role): `application/json` `ErrorResponse`
- `404` Not found or not readable: `application/json` `ErrorResponse`
- `409` The organization's last owner stays: `application/json` `ErrorResponse`
- `422` Validation Error: `application/json` `HTTPValidationError`

## Schemas

```yaml
InvitationWithdrawn:
  properties:
    invitation_id:
      type: string
      format: uuid
  type: object
  required:
    - invitation_id
  title: InvitationWithdrawn
ErrorResponse:
  properties:
    detail:
      type: string
      description: Error message describing what went wrong
  type: object
  required:
    - detail
  title: ErrorResponse
  description: Standard error response.
HTTPValidationError:
  properties:
    detail:
      items:
        $ref: "#/components/schemas/ValidationError"
      type: array
  type: object
  title: HTTPValidationError
ValidationError:
  properties:
    loc:
      items:
        type:
          - string
          - integer
      type: array
      title: Location
    msg:
      type: string
      title: Message
    type:
      type: string
      title: Error Type
    input: {}
    ctx:
      type: object
      title: Context
  type: object
  required:
    - loc
    - msg
    - type
  title: ValidationError
```
