---
title: "Ingest a session's messages into a profile"
method: POST
path: "/ai/memory/namespaces/{namespace}/profiles/{profile_id}/ingest"
tags: ["Memory"]
---

# Ingest a session's messages into a profile

`POST /ai/memory/namespaces/{namespace}/profiles/{profile_id}/ingest`

Store a session. Facts are extracted from whatever you send — the body is taken as any JSON value and stored whole, so a framework's own transcript shape works unchanged. `messages` of `role`/`content` is the conventional shape, not a requirement. An empty object or a null body is refused. Carry a `session_id` to name the session: re-ingesting the same one replaces what it held. Omit it and a session is opened and returned. Extraction runs asynchronously — poll the returned operation.

## Path parameters

- `profile_id` string, required
- `namespace` string, required

## Query parameters

- `session_id` string, nullable — Names the session. Re-ingesting the same session replaces what it held and keeps its `source_id`. Omit it to have one derived from the content and returned. No whitespace, control characters, or any of / \ # ? %.

## Request body

- IngestPayload — The session's messages, in whatever shape your framework produces. Any JSON value but null is accepted and stored whole, as long as it holds something to remember: a body with no content anywhere in it -- `{}`, `[]`, `""`, `{"messages": []}` -- is a 422.

## Response `202`

Successful Response

- IngestResponse
  - `data` AcceptedIngest, required
    - `operation_id` string, required
    - `profile_id` string, required
    - `session_id` string, required
    - `source_id` string, required — Identifies one source within its profile: an ingested session, or one remembered fact. Returned by `ingest` and `remember` when the write is accepted. Re-ingesting a session keeps its source id.

## Other responses

- `401` — Unauthorized
- `404` — The namespace does not exist
- `422` — Invalid request
- `502` — Upstream error

## Changes

> 99 revisions in range; 1 not diffed.

- **2026-09-25** `88481995b4ca` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/team-telnyx/apis/telnyx-api-2/changes/ai/memory/namespaces/:namespace/profiles/:profile_id/ingest/post.md)

---

[API](https://skmtc.dev/team-telnyx/apis/telnyx-api-2.md) · [All operations](https://skmtc.dev/team-telnyx/apis/telnyx-api-2/llms.txt) · [OpenAPI document](https://skmtc.dev/team-telnyx/apis/telnyx-api-2/revisions/227c33b1ac9c?raw)
