---
title: "Turn a service account back on."
method: POST
path: "/v1/organizations/current/service-accounts/{id}/enable"
tags: ["organizations"]
---

# Turn a service account back on.

`POST /v1/organizations/current/service-accounts/{id}/enable`

## Request

- Base URL: `https://api.50heads.com`
- URL: `https://api.50heads.com/v1/organizations/current/service-accounts/{id}/enable`
- 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

- OrganizationServiceAccountEnableResponse
  - `serviceAccount` object, required
    - `id` string, required
    - `name` string, required
    - `organizationId` string, required
    - `workspaceId` string, required
    - `workspaceName` string, required
    - `status` 'active' | 'disabled', required
    - `scopes` string[], required
    - `capDailyPence` integer, required
    - `capPerQuestionPence` integer, nullable, required
    - `spentTodayPence` integer, required
    - `clientId` string, required
    - `authMethod` 'client_secret' | 'private_key_jwt', required
    - `secrets` object[], required
      - `id` string, required
      - `hint` string, required
      - `createdAt` string, required
      - `expiresAt` string, nullable, required
      - `lastUsedAt` string, nullable, required
    - `jwks` object, nullable, required
      - `keys` object[], required
        - `kty` 'EC' | 'RSA', required
        - `kid` string
        - `alg` 'ES256' | 'RS256'
        - `use` 'sig'
        - `crv` string
        - `x` string
        - `y` string
        - `n` string
        - `e` string
    - `createdAt` string, required
    - `createdBy` object, nullable, required
      - `id` string, required
      - `name` string, nullable, required
    - `lastUsedAt` string, nullable, required
    - `disabledAt` string, nullable, 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)
