---
title: "Delete a service account. Its tokens, secrets and the webhook endpoints it made stop; the questions it asked stay with the workspace."
method: DELETE
path: "/v1/organizations/current/service-accounts/{id}"
tags: ["organizations"]
---

# Delete a service account. Its tokens, secrets and the webhook endpoints it made stop; the questions it asked stay with the workspace.

`DELETE /v1/organizations/current/service-accounts/{id}`

## Request

- Base URL: `https://api.50heads.com`
- URL: `https://api.50heads.com/v1/organizations/current/service-accounts/{id}`
- Auth: HTTP bearer

Organization admins only (403 `organization_admin_required`), on a browser session with a fresh proof in the `x-50h-reauth` header (401 `reauth_required`). It needs a person: API keys, connected apps and service accounts get 403 `session_required`. Every change is written to the organization's audit. Behind the `machineIdentities` sub-flag: 404 `not_found` while it is off. A service account gets tokens from https://auth.50heads.com/token with `grant_type=client_credentials` and its client id and secret (HTTP Basic or the body) or a private_key_jwt assertion; no refresh token, ask again when it expires.

## Path parameters

- `id` string, required

## Response `200`

OK

- OrganizationServiceAccountDeleteResponse
  - `ok` true, required

## Other responses

- `401`: No key or token, or it expired or was revoked.
- `403`: The key or token lacks the scope (`insufficient_scope`), or the action is not allowed.
- `404`: No such question, endpoint or delivery on this account.
- `429`: Too many requests; wait for Retry-After.

---

[API](https://skmtc.dev/50heads/apis/50heads-api.md) · [All operations](https://skmtc.dev/50heads/apis/50heads-api/llms.txt) · [OpenAPI document](https://skmtc.dev/50heads/apis/50heads-api/revisions/edbfecb1e360?raw)
