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

# Withdraw an invitation

> Cancel a queued or pending LinkedIn invitation tracked by OneShot.

Cancels an invitation OneShot sent or queued, before or after it reaches LinkedIn. Price: \$0.02 in production. Requires the `invite` grant and an `Idempotency-Key`. Standard API rate limits apply. The daily send cap does not block withdrawal.

<ParamField body="account_id" type="string" required>OneShot LinkedIn account ID.</ParamField>
<ParamField body="invitation_id" type="string" required>Stable OneShot invitation ID returned by the invite operation, not a provider ID.</ParamField>

Returns HTTP 202 with request and receipt IDs. Poll the request endpoint for one of:

* `cancelled_before_send`: cancelled locally and released the queued reservation.
* `withdrawn`: the provider confirmed withdrawal.
* `already_withdrawn`: this tracked invitation was already cancelled or withdrawn.
* `not_pending`: the invitation is no longer withdrawable, including an accepted connection.

Withdrawal only cancels the invitation. It never disconnects an established connection. It never restores the daily allowance for an invitation already sent. Sending again is a new explicit operation and is subject to LinkedIn's resend restrictions.

When the original send is uncertain, OneShot reconciles it before withdrawal. An unexplained provider 404 does not prove withdrawal. An uncertain withdrawal reports `withdrawal_unverified`. Retries target only the original provider invitation ID.

```typescript theme={null}
await agent.linkedinWithdrawInvitation({
  accountId, invitationId: invitation.invitation_id,
  idempotencyKey: 'event-jane-withdraw',
});
```

```python theme={null}
client.linkedin_withdraw_invitation(account_id, invitation["invitation_id"],
                                   idempotency_key="event-jane-withdraw")
```


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