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

# List facts

> List your own or an app user's saved facts, newest first.

A key set to memory for each user of your app must send the user's id in
`x-atlaso-user`; without it the call gets 400 `memory_scope_per_user`. A key
whose **Memory for** is **Me** reaches your own memory and sends no
`x-atlaso-user`; with it, the call gets 403 `memory_scope_owner`.

Page through the list with `limit` and `after`. See [Memory API](https://docs.atlaso.ai/gateway/memory-api.md).


## OpenAPI

````yaml api-reference/openapi.json GET /memory/facts
openapi: 3.1.0
info:
  title: Atlaso Gateway API
  version: 1.0.0
  description: An OpenAI-compatible API that calls your own provider keys and adds memory.
servers:
  - url: https://api.atlaso.ai/v1
security:
  - AtlasoKey: []
paths:
  /memory/facts:
    get:
      tags:
        - Memory
      summary: List facts
      description: >-
        Lists facts, newest first: the app user's facts for a key set to memory
        for each user of your app, or, for a Me key, the key's project and your
        personal facts. While a deletion of the whole user is running the list
        is empty; while one fact's deletion is running that fact is left out.
        See [Memory API](/gateway/memory-api).
      operationId: listMemoryFacts
      parameters:
        - $ref: '#/components/parameters/AppUser'
        - name: limit
          in: query
          required: false
          description: How many facts, 1 to 100.
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
        - name: after
          in: query
          required: false
          description: >-
            A fact id from this list (`last_id` of the page before). The list
            continues after it.
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: One page of facts.
          headers:
            x-atlaso-memory:
              $ref: '#/components/headers/MemoryReceipt'
            x-atlaso-paid-by:
              $ref: '#/components/headers/PaidBy'
            x-request-id:
              $ref: '#/components/headers/RequestId'
            cache-control:
              $ref: '#/components/headers/NoStore'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FactList'
        '400':
          description: >-
            The request or the app user's id was refused. Codes:
            `memory_scope_per_user`, `missing_user_id`, `user_id_not_accepted`,
            `unknown_parameter`, `invalid_limit`, `invalid_fact_id`,
            `invalid_after`.
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
            x-atlaso-memory:
              $ref: '#/components/headers/MemoryReceipt'
            x-atlaso-paid-by:
              $ref: '#/components/headers/PaidBy'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: >-
                    This key keeps memory for each user of your app. Use
                    atlaso.for_user(id).memory.
                  type: invalid_request_error
                  param: x-atlaso-user
                  code: memory_scope_per_user
                  doc_url: https://docs.atlaso.ai/gateway/errors#memory_scope_per_user
        '401':
          description: >-
            The Atlaso key is missing, invalid or revoked. Codes:
            `invalid_api_key`.
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
            x-atlaso-memory:
              $ref: '#/components/headers/MemoryReceipt'
            x-atlaso-paid-by:
              $ref: '#/components/headers/PaidBy'
            x-should-retry:
              description: >-
                `false`. Sent with `invalid_api_key`, when retrying soon cannot
                help. The OpenAI SDKs read it.
              schema:
                type: string
                enum:
                  - 'false'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: >-
                    Your Atlaso API key is missing, invalid or revoked. Set
                    Authorization: Bearer to an active key from the API keys
                    page.
                  type: authentication_error
                  param: null
                  code: invalid_api_key
                  doc_url: https://docs.atlaso.ai/gateway/errors#invalid_api_key
        '403':
          description: >-
            The key or this request cannot use the Memory API. Codes:
            `memory_scope_owner` (a Me key sent `x-atlaso-user`), `memory_off`
            (a Me key whose memory is Off), `gateway_not_enabled`.
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
            x-atlaso-memory:
              $ref: '#/components/headers/MemoryReceipt'
            x-atlaso-paid-by:
              $ref: '#/components/headers/PaidBy'
            x-should-retry:
              description: >-
                `false`. Sent only with `gateway_not_enabled`, when retrying
                soon cannot help. The OpenAI SDKs read it.
              schema:
                type: string
                enum:
                  - 'false'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: >-
                    This key uses your own memory. Use atlaso.memory, without a
                    user id.
                  type: permission_error
                  param: x-atlaso-user
                  code: memory_scope_owner
                  doc_url: https://docs.atlaso.ai/gateway/errors#memory_scope_owner
        '429':
          description: 'Too many requests on this key. Codes: `rate_limited`.'
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
            x-atlaso-memory:
              $ref: '#/components/headers/MemoryReceipt'
            x-atlaso-paid-by:
              $ref: '#/components/headers/PaidBy'
            retry-after:
              $ref: '#/components/headers/RetryAfter'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: Too many requests. Try again shortly.
                  type: rate_limit_error
                  param: null
                  code: rate_limited
                  doc_url: https://docs.atlaso.ai/gateway/errors#rate_limited
        '503':
          description: >-
            Memory is not reachable right now, or a deletion for this user has
            not finished. Safe to retry. Codes: `memory_unavailable`,
            `delete_pending`, `unavailable`, `not_configured`.
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
            x-atlaso-memory:
              $ref: '#/components/headers/MemoryReceipt'
            x-atlaso-paid-by:
              $ref: '#/components/headers/PaidBy'
            retry-after:
              $ref: '#/components/headers/RetryAfter'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: >-
                    A deletion for this user has not finished yet. Retry the
                    same request in a few seconds; retrying is safe.
                  type: api_error
                  param: null
                  code: delete_pending
                  doc_url: https://docs.atlaso.ai/gateway/errors#delete_pending
components:
  parameters:
    AppUser:
      name: x-atlaso-user
      in: header
      required: false
      description: >-
        Your app user's id, set by your server. A key set to memory for each
        user of your app must send it on every call; without it the call gets
        400 `memory_scope_per_user`, and an empty value gets 400
        `missing_user_id`. A key whose Memory for is Me reaches your own memory
        and must not send it: with it, the call gets 403 `memory_scope_owner`
        and nothing is read or written. 1 to 256 printable characters, not only
        spaces, with no API key or token in it. Send it once. Used exactly as
        sent.
      schema:
        type: string
        minLength: 1
        maxLength: 256
      example: demo-user-42
  headers:
    MemoryReceipt:
      description: >-
        What memory did: `status=...; ids=...; ms=...; reason=...; added=...;
        action=...`. `status` is `used`, `none`, `skipped`, `off` or `bypass`.
        With `x-atlaso-memory: off` it reads `status=off` and
        `reason=request_off`; a key whose memory is off gives
        `reason=key_mode_off`. Routes that do not use memory say
        `status=bypass`.
      schema:
        type: string
      example: status=none; ids=; ms=38; reason=no_match; added=0; action=none
    PaidBy:
      description: 'Always `own_key`: the provider bills your own key.'
      schema:
        type: string
        enum:
          - own_key
      example: own_key
    RequestId:
      description: Atlaso's id for this request. Quote it to support.
      schema:
        type: string
      example: req_4f1c2e9a7b6d4c3e8a1f0b2d
    NoStore:
      description: Answers are never cached.
      schema:
        type: string
      example: no-store
    RetryAfter:
      description: Seconds to wait before retrying.
      schema:
        type: string
      example: '2'
  schemas:
    FactList:
      type: object
      required:
        - object
        - data
        - first_id
        - last_id
        - has_more
      properties:
        object:
          type: string
          enum:
            - list
        data:
          type: array
          items:
            $ref: '#/components/schemas/Fact'
        first_id:
          type:
            - string
            - 'null'
        last_id:
          type:
            - string
            - 'null'
        has_more:
          type: boolean
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
            - type
            - param
            - code
            - doc_url
          properties:
            message:
              type: string
              description: What happened and what to do.
            type:
              type: string
              description: Error type, as OpenAI uses it.
              example: invalid_request_error
            param:
              type:
                - string
                - 'null'
              description: The field or header at fault, if any.
            code:
              type: string
              description: A stable code. A provider's own code may appear too.
            doc_url:
              type: string
              format: uri
              description: Where this code is explained on the Errors page.
    Fact:
      type: object
      required:
        - id
        - object
        - created
        - text
        - source
        - app_user
      properties:
        id:
          type: string
          format: uuid
        object:
          type: string
          enum:
            - memory.fact
        created:
          type: integer
          description: Unix seconds.
        text:
          type: string
          description: >-
            The stored fact. Stored text may differ from the input: recognised
            passwords, API keys and tokens are redacted, but unrecognised
            secrets and other sensitive details can remain.
        source:
          type: string
          enum:
            - api
            - learned
            - dashboard
        app_user:
          type: string
          description: A 12-character label for the app user, not the id you sent.
      example:
        id: 0b6f3c1e-2a4d-4e8f-9c1b-5d7e6f8a9b0c
        object: memory.fact
        created: 1763366400
        text: Prefers oat-milk lattes.
        source: api
        app_user: 3f9a1c7e5b2d
  securitySchemes:
    AtlasoKey:
      type: http
      scheme: bearer
      bearerFormat: sk-at-...
      description: >-
        Your Atlaso key in `Authorization: Bearer sk-at-...`. Send one
        Authorization header. A request that also sends `x-atlaso-key` is
        refused with 401.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.