> ## 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.

# ユーザーを無効化

> アカウントを削除せずに会社のユーザーを無効化し、有効なAPIトークンを失効させ、プロジェクトへのアクセスを解除します。`auth.delete_user` が必要です。このエンドポイントでは会社の管理者、staff権限を持つユーザー、サービスアカウントを無効化できません。無効なユーザーに再度リクエストしても成功します。



## OpenAPI

````yaml /ja/api-reference/openapi.json delete /users/{user_id}
openapi: 3.0.0
info:
  title: Corgea API
  version: 1.0.0
  description: Corgeaのスキャン機能および脆弱性管理機能を操作するためのAPI
servers:
  - url: https://www.corgea.app/api/v1
    description: 本番サーバー
  - url: https://eu.corgea.app/api/v1
    description: EU本番サーバー
security:
  - CorgeaToken: []
  - BearerAuth: []
paths:
  /users/{user_id}:
    delete:
      tags:
        - Users
      summary: ユーザーを無効化
      description: >-
        アカウントを削除せずに会社のユーザーを無効化し、有効なAPIトークンを失効させ、プロジェクトへのアクセスを解除します。`auth.delete_user`
        が必要です。このエンドポイントでは会社の管理者、staff権限を持つユーザー、サービスアカウントを無効化できません。無効なユーザーに再度リクエストしても成功します。
      operationId: deactivateUser
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: リクエストが成功しました
          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: トークンが無効か、指定されていません
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Missing or invalid authorization header
    Forbidden:
      description: 権限がないか、機能を利用できません
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Permission denied
    NotFound:
      description: リソースが見つかりません
      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キー 無効なユーザーのAPIトークンは拒否されます。
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Authorizationヘッダーで使用するOAuth2アクセストークン（JWT）

````

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