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

# Preview a candidate note before saving it

> Try a candidate note on one profile and see how that profile's summary would read under it, without saving the note and without touching the stored summary. Composes the same source query the apply path (`PATCH /ai/memory/namespaces/{namespace}/settings`) would use, so a preview cannot drift from what saving the note would produce. Reads the candidate alone -- the namespace's current instructions and the profile's stored summary are neither read nor replaced. Bounded at 120 seconds: the summary is generated on the spot rather than read from a stored one. Nothing about the request is stored.



## OpenAPI

````yaml /openapi/source/external/agent-memory/agent-memory.json post /ai/memory/namespaces/{namespace}/profiles/{profile_id}/summary/preview
openapi: 3.1.0
info:
  version: 1.0.0
  title: Telnyx API
  x-latency-category: interactive
  x-endpoint-cost: light
  description: >-
    Long-term memory for AI agents. A profile per user, caller, or agent: write
    memories in with `ingest` or `remember`, and recall them with `recall`.
    Facts are extracted, and contradictions resolve to the newest.
servers:
  - url: https://api.telnyx.com/v2
    description: Telnyx API v2
security:
  - bearerAuth: []
tags:
  - name: Memory
    description: Write memories into a profile and recall them.
  - name: Profiles
    description: What a namespace and a profile hold.
  - name: Sources
    description: What a profile stored, and what its memories came from.
  - name: Operations
    description: Whether a write has finished.
  - name: Settings
    description: How a namespace's summaries are written.
paths:
  /ai/memory/namespaces/{namespace}/profiles/{profile_id}/summary/preview:
    post:
      tags:
        - Memory
      summary: Preview a candidate note before saving it
      description: >-
        Try a candidate note on one profile and see how that profile's summary
        would read under it, without saving the note and without touching the
        stored summary. Composes the same source query the apply path (`PATCH
        /ai/memory/namespaces/{namespace}/settings`) would use, so a preview
        cannot drift from what saving the note would produce. Reads the
        candidate alone -- the namespace's current instructions and the
        profile's stored summary are neither read nor replaced. Bounded at 120
        seconds: the summary is generated on the spot rather than read from a
        stored one. Nothing about the request is stored.
      operationId: PreviewSummaryInstructions
      parameters:
        - name: namespace
          in: path
          required: true
          schema:
            type: string
            description: The namespace. `default` exists for every organization.
          description: The namespace. `default` exists for every organization.
        - name: profile_id
          in: path
          required: true
          schema:
            type: string
          description: >-
            The profile: your identifier for the user, caller or agent this
            memory is about.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PreviewSummaryRequest'
            example:
              instructions: Lead with billing status. Prefer plain language over jargon.
      responses:
        '200':
          description: >-
            The summary this profile would carry under the candidate note.
            `data.text` is `null` when nothing was generated -- the same signal
            `GET /summary` uses for a profile with no card yet.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PreviewSummaryResponse'
              example:
                data:
                  profile_id: user-42
                  text: |-
                    ## Profile Summary

                    - Billing: current, autopay on.
                    - Prefers Slack over email.
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TelnyxErrors'
              example:
                errors:
                  - code: '10009'
                    title: Authentication failed
                    detail: Could not find any usable credentials in the request.
                    source:
                      pointer: /
                    meta:
                      url: https://developers.telnyx.com/docs/overview/errors/10009
        '404':
          description: The namespace does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TelnyxErrors'
              example:
                errors:
                  - code: namespace_not_found
                    detail: no such namespace
        '422':
          description: >-
            The candidate note is longer than the 2000-character cap -- refused
            before anything is generated. The cap is the one `PATCH /settings`
            applies on save.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TelnyxErrors'
              example:
                errors:
                  - code: invalid_instructions
                    detail: instructions must be at most 2000 characters
        '502':
          description: Upstream error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TelnyxErrors'
              example:
                errors:
                  - code: upstream_error
                    detail: the memory dataplane is unavailable
components:
  schemas:
    PreviewSummaryRequest:
      properties:
        instructions:
          anyOf:
            - type: string
              maxLength: 2000
            - type: 'null'
          title: Instructions
          description: >-
            The candidate note to try. `null`, empty, or whitespace-only
            previews the neutral default -- the summary a profile returns to
            when instructions are cleared. Capped at 2000 characters, the same
            cap `PATCH /settings` applies on save; a longer note is refused with
            `422` before anything is generated.
      type: object
      title: PreviewSummaryRequest
      description: >-
        A candidate note to preview against one profile. The field is optional;
        omitting it, or sending null/empty/whitespace, previews the neutral
        default.
    PreviewSummaryResponse:
      properties:
        data:
          $ref: '#/components/schemas/PreviewedSummary'
      type: object
      required:
        - data
      title: PreviewSummaryResponse
    TelnyxErrors:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/TelnyxError'
    PreviewedSummary:
      properties:
        profile_id:
          type: string
          title: Profile Id
        text:
          anyOf:
            - type: string
            - type: 'null'
          title: Text
          description: >-
            The summary this profile would carry under the candidate note. Null
            when nothing was generated -- the same signal `GET /summary` uses
            for a profile with no card yet.
      type: object
      required:
        - profile_id
        - text
      title: PreviewedSummary
    TelnyxError:
      type: object
      properties:
        code:
          type: string
        title:
          type: string
        detail:
          type: string
        source:
          type: object
          properties:
            pointer:
              type: string
        meta:
          type: object
          properties:
            url:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Telnyx API key

````