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

# Deactivate user

> Deactivates a company user without deleting the account, revokes active API tokens, and clears project access. Requires `auth.delete_user`. Company admins, staff, and service principals cannot be deactivated through this endpoint. Repeating the request for an inactive user succeeds.



## OpenAPI

````yaml /api-reference/openapi.json delete /users/{user_id}
openapi: 3.0.0
info:
  title: Corgea API
  version: 1.0.0
  description: >-
    API for interacting with Corgea's scanning and vulnerability management
    features
servers:
  - url: https://www.corgea.app/api/v1
    description: Production server
  - url: https://eu.corgea.app/api/v1
    description: EU production server
security:
  - CorgeaToken: []
  - BearerAuth: []
paths:
  /users/{user_id}:
    delete:
      tags:
        - Users
      summary: Deactivate user
      description: >-
        Deactivates a company user without deleting the account, revokes active
        API tokens, and clears project access. Requires `auth.delete_user`.
        Company admins, staff, and service principals cannot be deactivated
        through this endpoint. Repeating the request for an inactive user
        succeeds.
      operationId: deactivateUser
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Request completed successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  user:
                    $ref: '#/components/schemas/CompanyUser'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    CompanyUser:
      type: object
      properties:
        id:
          type: integer
        email:
          type: string
          format: email
        first_name:
          type: string
        last_name:
          type: string
        active:
          type: boolean
        roles:
          type: array
          items:
            $ref: '#/components/schemas/UserRole'
        created_at:
          type: string
          format: date-time
    UserRole:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
  responses:
    Unauthorized:
      description: Invalid or missing token
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Missing or invalid authorization header
    Forbidden:
      description: Permission denied or feature unavailable
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Permission denied
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Policy not found
  securitySchemes:
    CorgeaToken:
      type: apiKey
      in: header
      name: CORGEA-TOKEN
      description: >-
        API key for authentication API tokens belonging to inactive users are
        rejected.
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: OAuth2 access token (JWT) in the Authorization header

````

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