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

# Get a user

> Fetches one user.



## OpenAPI

````yaml /openapi.json get /v1/users/{userId}
openapi: 3.1.0
info:
  title: Stockly Partner API
  description: >-
    Create users, give them stock, and read their portfolios. All requests and
    responses are JSON.
  version: 1.0.0
servers:
  - url: https://api.stockly.com
    description: Production (replace with your Stockly API base URL)
security:
  - apiKey: []
tags:
  - name: Users
    description: Your customers.
  - name: Stock awards
    description: Give users stock and read back award status.
  - name: Portfolio
    description: A user's live stock holdings.
  - name: Catalog
    description: Stocks available to give.
paths:
  /v1/users/{userId}:
    get:
      tags:
        - Users
      summary: Get a user
      description: Fetches one user.
      parameters:
        - name: userId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: The user
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: User not found in your app
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    UserResponse:
      type: object
      properties:
        user:
          $ref: '#/components/schemas/User'
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - bad_request
                - unauthorized
                - forbidden
                - not_found
                - conflict
                - unprocessable_entity
                - internal_error
                - upstream_error
            message:
              type: string
            details:
              description: Optional structured detail (e.g. validation issues).
            requestId:
              type: string
              description: Correlation id, also returned in the x-request-id header.
      example:
        error:
          code: conflict
          message: idempotencyKey was already used with a different payload
          details:
            idempotencyKey: order-1001-reward
          requestId: f0e1d2c3-4b5a-6789-0abc-def012345678
    User:
      type: object
      properties:
        id:
          type: string
          format: uuid
        appId:
          type: string
          format: uuid
        email:
          type:
            - string
            - 'null'
        externalId:
          type:
            - string
            - 'null'
        createdAt:
          type: string
          format: date-time
  responses:
    Unauthorized:
      description: Missing or invalid x-api-key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Your Stockly API key. Identifies your app; you never pass an app id.

````