---
title: "Delete a service account."
method: DELETE
path: "/organizations/{organizationId}/service-accounts/{serviceAccountId}"
tags: ["service-accounts"]
---

# Delete a service account.

`DELETE /organizations/{organizationId}/service-accounts/{serviceAccountId}`

## Request

- Base URL: `https://api.shorebird.dev/api/v1`
- URL: `https://api.shorebird.dev/api/v1/organizations/{organizationId}/service-accounts/{serviceAccountId}`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Permanently deletes the service account. Its API keys and trust
rules go with it, so any CI using them stops authenticating. This
cannot be undone.

Requires the `serviceAccounts.delete` permission, which only the
`admin` and `owner` roles hold. Personal access tokens and federated
tokens are refused whatever their role.

## Response `204`

The service account was deleted.

## Other responses

- `400`: The organization id (`organization_id_malformed`) or the service account id (`service_account_bad_request`) is not an integer.
- `403`: The caller lacks the `serviceAccounts.delete` permission, or authenticated with a credential that may never manage service accounts.
- `404`: No such organization or the caller is not a member of it (`organization_membership_guard_error`), or the organization has no service account with that id (`service_account_not_found`).
- `424`: A database step failed (`service_account_database_error`).
- `default`: Standard error response. Emitted for any non-2xx status where a body can be decoded into an [ErrorResponse].

---

[API](https://skmtc.dev/shorebird/apis/shorebird-codepush-api.md) - [All operations](https://skmtc.dev/shorebird/apis/shorebird-codepush-api/llms.txt) - [OpenAPI document](https://skmtc.dev/shorebird/apis/shorebird-codepush-api/revisions/941da8871d10?raw)
