---
title: "Revoke an external authentication link"
method: POST
path: "/api/v3/datasources/{datasource_name}/external-auth-links/{id}/revoke"
tags: ["Data source connections"]
---

# Revoke an external authentication link

`POST /api/v3/datasources/{datasource_name}/external-auth-links/{id}/revoke`

## Request

- Base URL: `https://embedded.improvado.io`
- URL: `https://embedded.improvado.io/api/v3/datasources/{datasource_name}/external-auth-links/{id}/revoke`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `dts_session_id`
- TypeScript: <https://skmtc.dev/improvado/apis/improvado-embedded-api-v3/docs/api/v3/datasources/:datasource_name/external-auth-links/:id/revoke/post.ts> (a function with typed inputs; its response is checked against the schema)

Revokes a not-yet-used external authentication link so it can no longer be used to
authenticate. Idempotent — revoking an already-revoked link returns `200` with the
existing revocation data. Returns `400` if the link was already used or has expired.

## Path parameters

- `datasource_name` string, required
- `id` integer, required

## Response `200`

Link revoked

- ExternalAuthLinkListItem: An external authentication link with its current status
  - `id` integer: External authentication link ID
  - `data_source` string: Data source name
  - `data_source_title` string: Human-readable data source title
  - `status` 'not_used' | 'used' | 'expired' | 'revoked_manually': Current status of the link
  - `created_at` string, date-time: When the link was generated
  - `sent_to_email` string, email: Email of the external user the link was generated for
  - `sender` string, email: Email of the user who generated the link
  - `revoked_at` string, date-time, nullable: When the link was revoked, if it was
  - `revoked_by` string: Email of the user who revoked the link; empty string if not revoked

## Other responses

- `400`: Link already used or expired
- `401`: Forbidden
- `404`: Link not found — the ID does not exist within this data source and workspace (including an unknown `datasource_name`).

---

[API](https://skmtc.dev/improvado/apis/improvado-embedded-api-v3.md) - [All operations](https://skmtc.dev/improvado/apis/improvado-embedded-api-v3/llms.txt) - [OpenAPI document](https://skmtc.dev/improvado/apis/improvado-embedded-api-v3/revisions/a881099bd6c4?raw)
