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

# Récupérer le profil

## Autorisations

Aucune autorisation n’est requise. Tout identifiant v3 valide peut appeler cet endpoint pour connaître sa propre identité : utilisateurs de service, utilisateurs de jeton d’accès personnel (PAT), sessions Devin et sessions Windsurf. La structure de la réponse varie selon le `principal_type` de l’appelant (`service_user`, `pat_user`, `devin_brain` ou `windsurf_session`).


## OpenAPI

````yaml fr/v3-openapi.yaml GET /v3/self
openapi: 3.1.0
info:
  description: API Devin v3 avec authentification par compte de service et RBAC
  title: Devin API v3
  version: 3.0.0
servers: []
security:
  - bearerAuth: []
paths:
  /v3/self:
    get:
      tags:
        - self
      summary: Récupérer le profil
      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: Réponse réussie
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Non autorisé
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Interdit
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Introuvable
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Conflit
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Contenu impossible à traiter
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Trop de requêtes
components:
  schemas:
    ServiceUserSelf:
      description: Informations d’identité d’un utilisateur de service authentifié.
      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: Informations d’identité d’un utilisateur PAT authentifié.
      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: >-
            Organisation dans laquelle s’exécutent les sessions Devin dans le
            cloud de l’appelant : celle désignée par x-cog-org-id ou, en son
            absence, la première organisation visible au niveau utilisateur.
            Dans les deux cas, l’organisation doit autoriser l’utilisation des
            sessions Devin au niveau utilisateur et ne peut jamais être
            l’organisation principale d’une Enterprise. Vaut null si aucune
            organisation ne remplit ces conditions.
          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: >-
            Organisation à laquelle est facturée l’utilisation de la CLI et de
            Desktop par l’utilisateur : l’organisation du compte ou, au sein
            d’une Enterprise, l’organisation de facturation principale de
            l’utilisateur. Null si aucune organisation n’est définie ou si
            l’utilisateur n’est pas autorisé à y utiliser les sessions Devin.
          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: Informations d’identité pour une session Brain Devin authentifiée.
      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: >-
        Informations d’identité pour un utilisateur authentifié d’une session
        Windsurf.
      properties:
        devin_sessions_org_id:
          anyOf:
            - type: string
            - type: 'null'
          description: "Organisation dans laquelle s'exécutent les sessions Devin dans le cloud de l'appelant\_: celle désignée par x-cog-org-id ou, en son absence, la première organisation visible par l'utilisateur. Dans les deux cas, il doit s'agir d'une organisation dans laquelle l'utilisateur est autorisé à utiliser des sessions Devin, et jamais de l'organisation principale d'une Enterprise. Null si aucune organisation ne remplit ces conditions."
          title: Devin Sessions Org Id
        org_id:
          title: Org Id
          type: string
        primary_billing_org_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Organisation à laquelle est facturée l’utilisation de la CLI et de
            Desktop par l’utilisateur : l’organisation du compte ou, dans une
            Enterprise, l’organisation de facturation principale de
            l’utilisateur. Null si aucune organisation n’est définie ou si
            l’utilisateur n’est pas autorisé à y utiliser les sessions Devin.
          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: "Corps d’erreur RFC 9457 application/problem+json pour l’API v3.\n\ndetail est conservé de l’ancien corps {\"detail\": ...} pour assurer la rétrocompatibilité\_; les\nautres membres sont ajoutés de manière additive. errors contient les échecs de validation\nau niveau des champs (422 uniquement)."
      properties:
        detail:
          anyOf:
            - type: string
            - type: 'null'
          description: Explication en langage clair, spécifique à cette occurrence.
          title: Detail
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Code exploitable par machine indiquant le refus d’une action bloquée
            (p. ex. "user_frozen", "migrated_session").
          title: Error Code
        errors:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          description: Erreurs de validation par champ (réponses 422 uniquement).
          title: Errors
        instance:
          anyOf:
            - type: string
            - type: 'null'
          description: Une référence d’URI (le chemin de la requête) pour cette occurrence.
          title: Instance
        status:
          description: Le code d’état HTTP.
          title: Status
          type: integer
        title:
          description: Un bref résumé du type de problème, compréhensible par un humain.
          title: Title
          type: string
        type:
          default: about:blank
          description: Une référence d’URI identifiant le type de problème.
          title: Type
          type: string
      required:
        - title
        - status
      title: ProblemDetail
      type: object
  securitySchemes:
    bearerAuth:
      description: "Identifiant de compte de service (préfixe\_: cog_)"
      scheme: bearer
      type: http

````

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