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

# Retrieves a list of traces for the authenticated user

> Returns paginated traces for the authenticated user within their organization.



## OpenAPI

````yaml GET /api/v1/context/traces
openapi: 3.1.0
info:
  title: Alchemyst AI API v1 documentation
  version: 1.0.0
  description: v1 API documentation for Alchemyst AI
servers:
  - url: https://platform-backend.getalchemystai.com
    description: production
security:
  - bearerAuth: []
tags: []
paths:
  /api/v1/context/traces:
    get:
      tags:
        - traces
      summary: Retrieves a list of traces for the authenticated user
      description: >-
        Returns paginated traces for the authenticated user within their
        organization.
      operationId: viewRawContextTracesForUser
      parameters:
        - in: query
          name: page
          schema:
            type: integer
            default: 1
          description: Page number for pagination
        - in: query
          name: limit
          schema:
            type: integer
            default: 10
          description: Number of traces per page
      responses:
        '200':
          description: Successfully retrieved traces
          content:
            application/json:
              schema:
                type: object
                required:
                  - traces
                  - pagination
                properties:
                  traces:
                    type: array
                    items:
                      type: object
                      required:
                        - _id
                        - userId
                        - organizationId
                        - type
                        - data
                        - createdAt
                        - updatedAt
                      properties:
                        _id:
                          type: string
                        userId:
                          type: string
                        organizationId:
                          type: string
                        type:
                          type: string
                        data:
                          type: object
                        createdAt:
                          type: string
                          format: date-time
                        updatedAt:
                          type: string
                          format: date-time
                  pagination:
                    type: object
                    required:
                      - page
                      - limit
                      - total
                      - totalPages
                      - hasNextPage
                      - hasPrevPage
                    properties:
                      page:
                        type: integer
                      limit:
                        type: integer
                      total:
                        type: integer
                      totalPages:
                        type: integer
                      hasNextPage:
                        type: boolean
                      hasPrevPage:
                        type: boolean
              example:
                traces:
                  - _id: trace_123
                    userId: user_123
                    organizationId: org_123
                    type: context.search
                    data:
                      query: >-
                        What did the customer ask about pricing for the Scale
                        plan?
                      source: support-inbox
                      fileName: support_thread_TCK-1234.txt
                    createdAt: '2025-01-10T12:35:10.000Z'
                    updatedAt: '2025-01-10T12:35:10.000Z'
                pagination:
                  page: 1
                  limit: 10
                  total: 1
                  totalPages: 1
                  hasNextPage: false
                  hasPrevPage: false
        '401':
          description: Unauthorized - User or organization not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: Unauthorized - Invalid user
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden - User lacks required scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    ErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          example: Invalid job id
        status:
          type: number
          example: 400
        error:
          type: object
          example: Error details
          required:
            - code
            - message
          properties:
            code:
              type: string
              example: UNAUTHORIZED
            message:
              type: string
              example: User not authenticated
            details:
              type: object
              additionalProperties: true
        statusText:
          type: string
          description: Error message (detailed in debug mode)
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````