---
title: "Revoke a service account API key"
method: POST
path: "/api/v0/service-accounts/{serviceAccountId}/api-keys/{keyId}/revoke"
tags: ["Service Accounts"]
---

# Revoke a service account API key

`POST /api/v0/service-accounts/{serviceAccountId}/api-keys/{keyId}/revoke`

## Request

- Base URL: `https://api.factory.ai`
- URL: `https://api.factory.ai/api/v0/service-accounts/{serviceAccountId}/api-keys/{keyId}/revoke`
- Auth: HTTP bearer

Revokes an API key for a service account. Once revoked, the key can no longer authenticate. Idempotent.

## Path parameters

- `serviceAccountId` string, required: Service account ID
- `keyId` string, required: API key ID

## Response `204`

Response for status 204

- RevokeServiceAccountApiKey204ResponseBody

## Other responses

- `401`: Response for status 401
- `403`: Response for status 403
- `404`: Response for status 404
- `500`: Response for status 500

---

[API](https://skmtc.dev/factory/apis/factory-public-api.md) - [All operations](https://skmtc.dev/factory/apis/factory-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/factory/apis/factory-public-api/revisions/061507532814?raw)
