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

# 自身の情報を取得

## 権限

権限は不要です。有効な v3 認証情報であれば、どれでもこのエンドポイントを呼び出して自身のアイデンティティを確認できます。対象は、サービスユーザー、パーソナルアクセストークン (PAT) ユーザー、Devin セッション、Windsurf セッションです。レスポンスの形式は、呼び出し元の `principal_type` (`service_user`、`pat_user`、`devin_brain`、`windsurf_session` のいずれか) によって異なります。


## OpenAPI

````yaml ja/v3-openapi.yaml GET /v3/self
openapi: 3.1.0
info:
  description: Service User 認証および RBAC に対応した Devin v3 API
  title: Devin API v3
  version: 3.0.0
servers: []
security:
  - bearerAuth: []
paths:
  /v3/self:
    get:
      tags:
        - self
      summary: 自身の情報を取得
      operationId: handle_get_self_v3_self_get
      responses:
        '200':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/ServiceUserSelf'
                  - $ref: '#/components/schemas/PatUserSelf'
                  - $ref: '#/components/schemas/DevinBrainUserSelf'
                  - $ref: '#/components/schemas/WindsurfSessionUserSelf'
                title: Response Handle Get Self V3 Self Get
          description: 成功レスポンス
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 未認証
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: アクセス禁止
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 見つかりません
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 競合
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 処理できない内容
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: リクエストが多すぎます
components:
  schemas:
    ServiceUserSelf:
      description: 認証済みのサービスユーザーのIdentity情報。
      properties:
        org_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Org Id
        principal_type:
          const: service_user
          title: Principal Type
          type: string
        service_user_id:
          title: Service User Id
          type: string
        service_user_name:
          title: Service User Name
          type: string
      required:
        - principal_type
        - service_user_id
        - service_user_name
      title: ServiceUserSelf
      type: object
    PatUserSelf:
      description: 認証済みのPATユーザーのIdentity情報。
      properties:
        api_key_id:
          title: Api Key Id
          type: string
        api_key_name:
          title: Api Key Name
          type: string
        devin_sessions_org_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            呼び出し元の Devin Cloud セッションの run 先となる組織。x-cog-org-id
            で指定された組織、または指定がない場合はユーザーに表示される最初の組織です。いずれの場合も、ユーザーが Devin
            セッションを利用できる組織に限られ、エンタープライズの主要組織は対象外です。該当する組織がない場合は Null。
          title: Devin Sessions Org Id
        org_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Org Id
        primary_billing_org_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            ユーザーのCLIおよびDesktopの使用量の請求先となる組織。アカウントの組織、またはエンタープライズの場合はユーザーのプライマリ請求組織です。該当する組織がない場合、またはユーザーがその組織でDevin
            セッションを利用できない場合はNullです。
          title: Primary Billing Org Id
        principal_type:
          const: pat_user
          title: Principal Type
          type: string
        user_id:
          title: User Id
          type: string
        user_name:
          title: User Name
          type: string
      required:
        - principal_type
        - user_id
        - user_name
        - api_key_id
        - api_key_name
      title: PatUserSelf
      type: object
    DevinBrainUserSelf:
      description: 認証済みのDevin BrainセッションのIdentity情報。
      properties:
        creator_service_user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Creator Service User Id
        devin_id:
          title: Devin Id
          type: string
        org_id:
          title: Org Id
          type: string
        principal_type:
          const: devin_brain
          title: Principal Type
          type: string
        user_id:
          title: User Id
          type: string
      required:
        - principal_type
        - devin_id
        - org_id
        - user_id
      title: DevinBrainUserSelf
      type: object
    WindsurfSessionUserSelf:
      description: 認証済みのWindsurfセッションユーザーのIdentity情報。
      properties:
        devin_sessions_org_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            呼び出し元が Devin Cloud セッションを run する組織です。x-cog-org-id
            で指定された組織、または指定がない場合はユーザーに表示される最初の組織になります。いずれの場合も、ユーザーが Devin
            セッションを利用できる組織に限られ、Enterprise のプライマリ組織は対象外です。該当する組織がない場合は Null です。
          title: Devin Sessions Org Id
        org_id:
          title: Org Id
          type: string
        primary_billing_org_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            ユーザーの CLI および Desktop
            の使用量の請求先となる組織。アカウントの組織、またはエンタープライズの場合はユーザーのプライマリ請求組織です。該当する組織がない場合、またはユーザーがその組織で
            Devin セッションを利用する権限を持たない場合は Null です。
          title: Primary Billing Org Id
        principal_type:
          const: windsurf_session
          title: Principal Type
          type: string
        user_id:
          title: User Id
          type: string
        user_name:
          anyOf:
            - type: string
            - type: 'null'
          title: User Name
      required:
        - principal_type
        - user_id
        - org_id
      title: WindsurfSessionUserSelf
      type: object
    ProblemDetail:
      description: >-
        v3 API 用の RFC 9457 application/problem+json エラーボディ。


        detail は後方互換性のため、レガシーな {"detail": ...}
        ボディから引き継がれます。その他のメンバーは追加式です。errors にはフィールドレベルのバリデーションエラーが含まれます（422
        の場合のみ）。
      properties:
        detail:
          anyOf:
            - type: string
            - type: 'null'
          description: この事象に固有の、人が読める説明。
          title: Detail
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          description: ブロックされた操作の拒否理由を示す機械可読コード（例："user_frozen"、"migrated_session"）。
          title: Error Code
        errors:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          description: フィールド単位のバリデーションエラー（422 レスポンスのみ）。
          title: Errors
        instance:
          anyOf:
            - type: string
            - type: 'null'
          description: この発生箇所の URI 参照（リクエストパス）。
          title: Instance
        status:
          description: HTTP ステータスコード。
          title: Status
          type: integer
        title:
          description: 問題タイプを人が読める短い要約。
          title: Title
          type: string
        type:
          default: about:blank
          description: 問題タイプを識別する URI 参照。
          title: Type
          type: string
      required:
        - title
        - status
      title: ProblemDetail
      type: object
  securitySchemes:
    bearerAuth:
      description: 'サービスユーザーの認証情報（接頭辞: cog_）'
      scheme: bearer
      type: http

````

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