> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lerian.studio/llms.txt
> Use this file to discover all available pages before exploring further.

# Turn a turned-off account back on

> Turns back on an account of your organization that is turned off, whatever turned it off, with your `reason` in the audit. Requires the `user-status` `patch` permission. The account can sign in again right away; sessions from before it was turned off stay closed. Only a person can turn an account back on; a machine token is refused.

Failures:
- `400` — `reason` is missing, blank or longer than 200 characters, or the id is not a UUID.
- `401` — the access token is missing, expired or invalid, or it is a machine token.
- `403` — your role lacks the `user-status` `patch` permission.
- `404` — no such user in your organization.
- `409 IDE-1080` — the account is not turned off. Nothing was called, so its sessions stay.
- `422 IDE-1081` — a Lerian support account or an account of the built-in organization.
- `503 IDE-0066` — the identity provider is unavailable (unreachable, too slow to answer, or failing). Nothing about the request was wrong; retry it later.



## OpenAPI

````yaml /es/openapi/v3-current/AM-identity.yaml post /v1/users/{id}/enable
openapi: 3.1.0
info:
  contact:
    email: contact@lerian.studio
    name: Lerian Studio
    url: https://lerian.studio
  description: OpenAPI 3.1 surface for the Access Manager identity component.
  license:
    name: Lerian Studio General License
  title: Access Manager Identity API
  version: v1
servers:
  - url: https://identity.sandbox.lerian.net
security: []
tags:
  - description: >-
      M2M-only: each plugin declares its own permissions, roles and M2M
      contract, and the server reconciles them.
    name: Declarations
  - description: >-
      A tenant administrator's customers. Each partner holds what its
      credentials may DO (permissions, per product) and WHERE they may do it
      (scope, per product and dimension); an M2M application attached to one is
      confined to that intersection. Administrator-only: authorized on the
      "partners" resource, and every route resolves the owning organization from
      the caller's token.
    name: Partners
paths:
  /v1/users/{id}/enable:
    post:
      tags:
        - Users
      summary: Turn a turned-off account back on
      description: >-
        Turns back on an account of your organization that is turned off,
        whatever turned it off, with your `reason` in the audit. Requires the
        `user-status` `patch` permission. The account can sign in again right
        away; sessions from before it was turned off stay closed. Only a person
        can turn an account back on; a machine token is refused.


        Failures:

        - `400` — `reason` is missing, blank or longer than 200 characters, or
        the id is not a UUID.

        - `401` — the access token is missing, expired or invalid, or it is a
        machine token.

        - `403` — your role lacks the `user-status` `patch` permission.

        - `404` — no such user in your organization.

        - `409 IDE-1080` — the account is not turned off. Nothing was called, so
        its sessions stay.

        - `422 IDE-1081` — a Lerian support account or an account of the
        built-in organization.

        - `503 IDE-0066` — the identity provider is unavailable (unreachable,
        too slow to answer, or failing). Nothing about the request was wrong;
        retry it later.
      operationId: enableUser
      parameters:
        - description: Id of the account to turn back on.
          in: path
          name: id
          required: true
          schema:
            description: Id of the account to turn back on.
            examples:
              - 5b3c8f2e-1d4a-4c6b-9e7f-0a1b2c3d4e5f
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserEnableInput'
              description: Why the account is turned back on.
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserEnableResponse'
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
          description: Conflict
        '413':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Request Entity Too Large
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
          description: Unprocessable Entity
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
          description: Internal Server Error
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
          description: Service Unavailable
      security:
        - BearerAuth: []
components:
  schemas:
    UserEnableInput:
      additionalProperties: false
      properties:
        reason:
          description: >-
            Why the account is turned back on; kept in the audit. Required, 1 to
            200 characters; leading and trailing spaces are dropped and a blank
            reason is refused.
          examples:
            - Google account was suspended by mistake and is active again
          maxLength: 200
          minLength: 1
          type: string
      required:
        - reason
      type: object
    UserEnableResponse:
      additionalProperties: false
      properties:
        enabled:
          description: 'True: the account is on.'
          examples:
            - true
          type: boolean
        userId:
          description: Id of the account.
          examples:
            - 5b3c8f2e-1d4a-4c6b-9e7f-0a1b2c3d4e5f
          type: string
        userName:
          description: User name of the account.
          examples:
            - bob
          type: string
      type: object
    HTTPError:
      additionalProperties: false
      properties:
        code:
          type: string
        entityType:
          type: string
        err: {}
        message:
          type: string
        title:
          type: string
      type: object
    Detail:
      additionalProperties: true
      properties:
        code:
          description: >-
            Stable, machine-readable domain error code scoped to the emitting
            service (format: <SERVICE>-NNNN).
          type: string
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          examples:
            - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type:
            - array
            - 'null'
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          examples:
            - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
            - 400
          format: int64
          type: integer
        title:
          description: >-
            A short, human-readable summary of the problem type. This value
            should not change between occurrences of the error.
          examples:
            - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
            - https://example.com/errors/example
          format: uri
          type: string
        upstream:
          $ref: '#/components/schemas/Upstream'
          description: >-
            RFC 9457 extension member: the error a proxied third-party provider
            reported. Absent unless the emitting service explicitly surfaced
            one.
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
    Upstream:
      additionalProperties: false
      properties:
        code:
          description: The upstream provider's own error code, verbatim.
          examples:
            - E4001
          type: string
        message:
          description: >-
            The upstream provider's own error message, verbatim (bounded, never
            its raw response body).
          examples:
            - account not found at provider
          type: string
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: JWT bearer token issued by the identity provider.
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.