# `revokeInvitation()`

Revokes the given invitation.

Revoking an invitation makes the invitation email link unusable. However, it doesn't prevent the user from signing up if they follow the sign up flow.

Only active (i.e., non-revoked) invitations can be revoked.

Returns the revoked [`Invitation`](/content/docs/reference/backend/types/backend-invitation/index.html).

```
function revokeInvitation(invitationId: string): Promise<Invitation>
```

## [Parameters](/content/docs/reference/backend/invitations/revoke-invitation#parameters/index.html)

- Name: `invitationId`
  - Type: `string`
  - Description: The ID of the invitation to revoke.

## [Usage](/content/docs/reference/backend/invitations/revoke-invitation#usage/index.html)

Note:
Using `clerkClient` varies based on the SDK you're using. Refer to the [overview](/content/docs/reference/backend/overview/index.html) for usage details, including guidance on [how to access the `userId` and other properties](/content/docs/reference/backend/overview#example-get-the-user-id-and-other-properties/index.html).

```
const invitationId = 'inv_123'

const response = await clerkClient.invitations.revokeInvitation(invitationId)
```

## [Example](/content/docs/reference/backend/invitations/revoke-invitation#example/index.html)

app/api/example/route.ts

```
import { clerkClient } from '@clerk/nextjs/server'
import { NextResponse } from 'next/server'

export async function POST() {
  // Initialize clerkClient
  const client = await clerkClient()

// Use the `revokeInvitation()` method to revoke the invitation
  const invitation = await client.invitations.revokeInvitation({
    invitationId: 'invitation_123',
  })

return NextResponse.json({ message: 'Invitation revoked' })
}
```

## [Backend API (BAPI) endpoint](/content/docs/reference/backend/invitations/revoke-invitation#backend-api-bapi-endpoint/index.html)

This method in the SDK is a wrapper around the BAPI endpoint `POST/invitations/{invitation_id}/revoke`. See the [BAPI reference⁠](/content/docs/reference/backend-api/tag/invitations/POST/invitations/%7Binvitation_id%7D/revoke/index.html) for more information.

Here's an example of making a request directly to the endpoint using cURL.

Replace the `<invitation_id>` with the ID of the invitation you want to revoke and replace `YOUR_SECRET_KEY` with your Clerk Secret Key⁠.

```
curl https://api.clerk.com/v1/invitations/<invitation_id>/revoke -X POST -H "Authorization:Bearer YOUR_SECRET_KEY" -H 'Content-Type:application/json'
```
