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

# Who Am I

Check your API caller identity with the LoyaltyLion API. This will return an
`identity` object with details about the authenticating API method and its
associated permissions.

If your API authentication is invalid, this endpoint will return a `401` response.


## OpenAPI

````yaml /api-reference/v2/openapi.json GET /v2/identity/whoami
openapi: 3.1.1
info:
  title: LoyaltyLion Admin API
  version: v2
servers:
  - url: https://api.loyaltylion.com
security: []
tags:
  - name: identity
  - name: activities
  - name: orders
  - name: transactions
  - name: customers
  - name: webhooks
  - name: emails
  - name: sites
  - name: reviews
  - name: rewards
  - name: integrations
  - name: gatsby
paths:
  /v2/identity/whoami:
    get:
      tags:
        - identity
      operationId: identity.whoami
      parameters: []
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IdentityWhoamiResponseBody'
        '400':
          $ref: '#/components/responses/ClientErrorBadRequest'
        '401':
          description: '401'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties:
                          type: string
                    required:
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '403':
          description: '403'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties:
                          type: string
                    required:
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
      security:
        - ProgramApiKey: []
        - SiteTokenSecret: []
components:
  schemas:
    IdentityWhoamiResponseBody:
      type: object
      properties:
        identity:
          oneOf:
            - $ref: '#/components/schemas/ApiIdentityApiKey'
            - $ref: '#/components/schemas/ApiIdentityOAuthClient'
            - $ref: '#/components/schemas/ApiIdentitySiteTokenSecret'
          type: object
          discriminator:
            propertyName: kind
            mapping:
              api_key:
                $ref: '#/components/schemas/ApiIdentityApiKey'
              oauth_client:
                $ref: '#/components/schemas/ApiIdentityOAuthClient'
              site_token_secret:
                $ref: '#/components/schemas/ApiIdentitySiteTokenSecret'
      required:
        - identity
      additionalProperties: false
    ApiIdentityApiKey:
      title: API key
      example:
        kind: api_key
        account_id: 1
        program_id: 2
        scopes:
          - read_customers
          - read_orders
        integration: null
      type: object
      properties:
        kind:
          type: string
          const: api_key
        account_id:
          type: number
        program_id:
          type: number
        scopes:
          type: array
          items:
            type: string
        integration:
          anyOf:
            - description: >-
                Details of the Integration this API identity is connected to, if
                any
              type: object
              properties:
                id:
                  type: number
                kind:
                  type: string
                enabled:
                  type: boolean
              required:
                - id
                - kind
                - enabled
              additionalProperties: false
            - type: 'null'
      required:
        - kind
        - account_id
        - program_id
        - scopes
        - integration
      additionalProperties: false
    ApiIdentityOAuthClient:
      title: OAuth client
      example:
        kind: oauth_client
        account_id: 1
        program_id: 1
        oauth_client_id: 271eeb2e0b9f606ca9e5
        scopes:
          - read_customers
          - read_orders
      type: object
      properties:
        kind:
          type: string
          const: oauth_client
        account_id:
          type: number
        program_id:
          type: number
        oauth_client_id:
          type: string
        scopes:
          type: array
          items:
            type: string
      required:
        - kind
        - account_id
        - program_id
        - oauth_client_id
        - scopes
      additionalProperties: false
    ApiIdentitySiteTokenSecret:
      title: Site token & secret
      example:
        kind: site_token_secret
        account_id: 1
        site_id: 1
      type: object
      properties:
        kind:
          type: string
          const: site_token_secret
        account_id:
          type: number
        site_id:
          type: number
      required:
        - kind
        - account_id
        - site_id
      additionalProperties: false
  responses:
    ClientErrorBadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  message:
                    type: string
                  details:
                    type: object
                    additionalProperties:
                      type: string
                required:
                  - message
            required:
              - error
  securitySchemes:
    ProgramApiKey:
      type: http
      scheme: bearer
      description: >-
        An API key linked to a Program in LoyaltyLion, with a set of permissions
        (scopes). API keys can be created manually, or acquired through an
        OAuth2 flow. The API key should be provided as a `Bearer` token in the
        `Authorization` header
    SiteTokenSecret:
      type: http
      scheme: basic
      description: >-
        [DEPRECATED] Authenticate using a LoyaltyLion site's `token` as
        username, and its `secret` as the password. This authentication method
        is deprecated and will be removed in future. Use the `ProgramApiKey`
        authentication method instead

````