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

# Get Self

## Permissions

No permission is required. Any valid v3 credential can call this endpoint to discover its own identity: service users, personal access token (PAT) users, Devin sessions, and Windsurf sessions. The response shape depends on the caller's `principal_type` (`service_user`, `pat_user`, `devin_brain`, or `windsurf_session`).


## OpenAPI

````yaml v3-openapi.yaml GET /v3/self
openapi: 3.1.0
info:
  description: Devin v3 API with Service User authentication and RBAC
  title: Devin API v3
  version: 3.0.0
servers: []
security:
  - bearerAuth: []
paths:
  /v3/self:
    get:
      tags:
        - self
      summary: Get Self
      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: Successful Response
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Conflict
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Unprocessable Content
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Too Many Requests
components:
  schemas:
    ServiceUserSelf:
      description: Identity information for an authenticated service user.
      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: Identity information for an authenticated PAT user.
      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: >-
            Organization the caller's Devin Cloud sessions run in: the one named
            with x-cog-org-id, or without it the first organization visible to
            the user. Either way only an organization in which the user may use
            Devin sessions, and never an enterprise's primary organization. Null
            when there is none.
          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: >-
            Organization the user's CLI and Desktop usage is billed to: the
            account's organization, or in an enterprise the user's primary
            billing organization. Null when there is none or the user may not
            use Devin sessions in it.
          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: Identity information for an authenticated Devin brain session.
      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: Identity information for an authenticated Windsurf session user.
      properties:
        devin_sessions_org_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Organization the caller's Devin Cloud sessions run in: the one named
            with x-cog-org-id, or without it the first organization visible to
            the user. Either way only an organization in which the user may use
            Devin sessions, and never an enterprise's primary organization. Null
            when there is none.
          title: Devin Sessions Org Id
        org_id:
          title: Org Id
          type: string
        primary_billing_org_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Organization the user's CLI and Desktop usage is billed to: the
            account's organization, or in an enterprise the user's primary
            billing organization. Null when there is none or the user may not
            use Devin sessions in it.
          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: >-
        RFC 9457 application/problem+json error body for the v3 API.


        detail is retained from the legacy {"detail": ...} body for back-compat;
        the

        other members are additive. errors carries field-level validation
        failures

        (422 only).
      properties:
        detail:
          anyOf:
            - type: string
            - type: 'null'
          description: A human-readable explanation specific to this occurrence.
          title: Detail
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Machine-readable code for blocked-action refusals (e.g.
            "user_frozen", "migrated_session").
          title: Error Code
        errors:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          description: Field-level validation errors (422 responses only).
          title: Errors
        instance:
          anyOf:
            - type: string
            - type: 'null'
          description: A URI reference (the request path) for this occurrence.
          title: Instance
        status:
          description: The HTTP status code.
          title: Status
          type: integer
        title:
          description: A short, human-readable summary of the problem type.
          title: Title
          type: string
        type:
          default: about:blank
          description: A URI reference identifying the problem type.
          title: Type
          type: string
      required:
        - title
        - status
      title: ProblemDetail
      type: object
  securitySchemes:
    bearerAuth:
      description: 'Service User credential (prefix: cog_)'
      scheme: bearer
      type: http

````

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