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

# Revoke a Workspace Invitation

> Cancel an invitation that was issued in your current workspace and reaches no other.

Revokes an invitation from the workspace side. Revoking takes the invitee out of the organization, so a workspace admin can only revoke an invitation that stays entirely inside their workspace: one issued in this workspace, whose invitee is in no other workspace.

> [!WARNING]
>
> Revoking removes the invitee's pending membership with every group and grant it carries. If the invitation was the only reason that person existed in Nekt, the account is deleted too. This cannot be undone.

## Shared invitations

When an invitation reaches beyond this workspace, the endpoint answers `409` with the code `invitation_shared`. The [List Workspace Invitations](https://docs.nekt.com/platform-api/invitations/workspace/list.md) response flags these in advance with `shared: true`. An organization owner or admin revokes them through [Revoke an Invitation](https://docs.nekt.com/platform-api/invitations/organization/revoke.md).

## Example

```bash theme={null}
curl --request DELETE \
  --url https://api.nekt.ai/api/v1/workspace/invitations/c1f0a9d4-5b62-4e18-9a73-2d8e4f6b0c51/ \
  --header "x-api-key: YOUR_API_KEY"
```

## Response

`204 No Content`.

## Authentication

This endpoint requires an [API key](https://docs.nekt.com/platform-api/introduction.md#create-an-api-key) created by a **workspace admin** of the key's workspace. Organization owners and admins are admins of every workspace.

## Errors

| Status | When |
| - | - |
| `403` | The key's creator is not an admin of this workspace. |
| `404` | No outstanding invitation with that `id` is waiting in this workspace. |
| `409` | `invitation_shared`: the invitation was issued elsewhere, or the invitee is in another workspace too. |

## Related

* [List Workspace Invitations](https://docs.nekt.com/platform-api/invitations/workspace/list.md): where the `id` and `shared` come from.
* [Revoke an Invitation](https://docs.nekt.com/platform-api/invitations/organization/revoke.md): the organization-level revoke.


## OpenAPI

````yaml DELETE /api/v1/workspace/invitations/{id}/
openapi: 3.0.3
info:
  title: Nekt API
  version: v1
  description: Nekt API Documentation
  contact:
    email: support@nekt.ai
servers:
  - url: https://api.nekt.ai
security: []
paths:
  /api/v1/workspace/invitations/{id}/:
    delete:
      tags:
        - v1
      description: >-
        Revoke an invitation issued in your current workspace. An invitation
        that reaches beyond it

        (`shared`: issued elsewhere, or its invitee is in another workspace too)
        is revoked from the

        organization's invitations instead (409 `invitation_shared`).
      operationId: v1_workspace_invitations_destroy
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          description: The invitation's `id`.
          required: true
      responses:
        '204':
          description: No response body
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: 'API Key authentication. Format: ''x-api-key: api_key'''

````

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