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

# Get a user

> Resolve a human participant your agent is in conversation with. Every `message.received` event carries `data.message.sender.id` (a `usr_…` id); pass it here to read that sender's name and messaging phone number — enough to greet them or match them to an existing account.

Scope: the user must currently share an active conversation (direct or group) with your agent. Any other id — unknown, or a user you have no active conversation with — returns `404` so the endpoint can neither enumerate accounts nor confirm who owns a phone number.




## OpenAPI

````yaml /api-reference/openapi.yaml get /v1/users/{user_id}
openapi: 3.1.0
info:
  title: Relay developer API
  version: '0.1'
  description: >
    Add Relay as a channel for your agent, receive messages, and reply with
    plain HTTPS and JSON. Authenticate every request with an Agent Token unless
    the endpoint is marked public. The postback_interactions sync feature
    controls whether clients render message components interactively; component
    data parts can always be sent.
  x-relay-feature-availability:
    postback_interactions: off-by-default-preview
  license:
    name: Proprietary
    identifier: LicenseRef-Proprietary
servers:
  - url: https://api.relayapp.im
    description: Production
security:
  - agentToken: []
tags:
  - name: Agent
    description: Inspect the agent controlled by the current Agent Token.
  - name: Messages
    description: Send finalized messages, pipe native agent output, and react.
  - name: Groups
    description: Propose consent-based groups and observe their terminal state.
  - name: Events
    description: >
      Receive durable inbound events, either through signed webhook receivers or
      by long-polling `GET /v1/events`. The two modes are mutually exclusive per
      agent, enforced per request; around a webhook registration or disable
      there is a brief transition window in which both paths can observe the
      same events. Delivery is at least once everywhere — always deduplicate by
      `event_id`.
  - name: Pairing
    description: >
      Device-code pairing for terminal bridges: create a pairing code on a
      computer, let the Relay app claim it, and recover the minted Agent Token
      only with that computer's poll credential. The token never travels to the
      phone.
  - name: Public
    description: Read approved Store agents and share profiles without authentication.
paths:
  /v1/users/{user_id}:
    get:
      tags:
        - Agent
      summary: Get a user
      description: >
        Resolve a human participant your agent is in conversation with. Every
        `message.received` event carries `data.message.sender.id` (a `usr_…`
        id); pass it here to read that sender's name and messaging phone number
        — enough to greet them or match them to an existing account.


        Scope: the user must currently share an active conversation (direct or
        group) with your agent. Any other id — unknown, or a user you have no
        active conversation with — returns `404` so the endpoint can neither
        enumerate accounts nor confirm who owns a phone number.
      operationId: getUser
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: string
          description: The `sender.id` from a `message.received` event.
          example: usr_01JZU1F0BD
      responses:
        '200':
          description: The resolved user profile.
          content:
            application/json:
              schema:
                type: object
                required:
                  - user
                properties:
                  user:
                    $ref: '#/components/schemas/UserProfile'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    UserProfile:
      type: object
      additionalProperties: false
      description: >
        A human participant your agent shares a conversation with. `name` is
        canonical; `first_name`/`last_name` are a convenience split of `name` on
        the first space (a two-word given name puts its tail in `last_name`), so
        greet with them but store `name` if you need the exact value.
      required:
        - id
        - name
        - first_name
        - last_name
        - phone_number
        - avatar_url
        - created_at
      properties:
        id:
          type: string
          example: usr_01JZU1F0BD
        name:
          type: string
          example: Rushil Kagithala
        first_name:
          type: string
          example: Rushil
        last_name:
          type: string
          description: Empty when the name is a single word.
          example: Kagithala
        phone_number:
          type:
            - string
            - 'null'
          description: >
            The user's verified messaging number in E.164. Null only for a demo
            or email-only account.
          example: '+13135550123'
        avatar_url:
          type:
            - string
            - 'null'
          format: uri
          maxLength: 2048
        created_at:
          type: string
          format: date-time
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              example: invalid_request
            message:
              type: string
              example: conversation_id is required
  responses:
    Unauthorized:
      description: Token is absent or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The resource does not exist or is not visible to this agent.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    agentToken:
      type: http
      scheme: bearer
      description: Agent Token (`rly_live_…`), shown once at agent creation.

````