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

# Identify a user or group

> Identify a user, group, or both.



## OpenAPI

````yaml post /api/identify
openapi: 3.1.0
info:
  title: Waystone API
  description: Development documentation
  version: 1.0.0
servers:
  - url: http://localhost:3000
    description: Local server
security:
  - bearerAuth: []
paths:
  /api/identify:
    post:
      summary: Identify a user or group
      description: Identify a user, group, or both.
      operationId: identify
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Identify'
      responses:
        '200':
          description: Successful greeting response
          content:
            application/json:
              schema:
                type: object
                properties:
                  user:
                    type:
                      - string
                      - 'null'
                    description: ID of user, if user was provided
                  group:
                    type:
                      - string
                      - 'null'
                    description: ID of group, if group was provided
                required:
                  - user
                  - group
components:
  schemas:
    Identify:
      type: object
      properties:
        user:
          anyOf:
            - type: string
            - type: object
              properties:
                id:
                  type: string
                metadata:
                  type: object
                  additionalProperties:
                    anyOf:
                      - type: string
                      - type: number
                      - type: boolean
              required:
                - id
                - metadata
          example: my-user-id
        group:
          anyOf:
            - type: string
            - type: object
              properties:
                id:
                  type: string
                metadata:
                  type: object
                  additionalProperties:
                    anyOf:
                      - type: string
                      - type: number
                      - type: boolean
              required:
                - id
                - metadata
          example:
            id: my-group-id
            metadata:
              plan: pro
      description: "User, group, or both to identify. Records are created for users or groups with appropriate metadata, or metadata is updated for existing users or groups.\n\t\t\t\tWhen a user is provided alongside a group, a link between the user and group is created."
      examples:
        - user:
            id: user-1
            metadata:
              name: John
        - user: user-2
          group:
            id: group-2
            metadata:
              name: An Org
              domain: finance
              plan: enterprise
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````