---
title: "Create Memory Internal"
method: POST
path: "/api/internal/memories"
tags: ["agent-memories"]
---

# Create Memory Internal

`POST /api/internal/memories`

## Request

- Base URL: `https://api.tintin-x.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.tintin-x.com/api/internal/memories`
- Auth: HTTP bearer

Internal-key write path.

Server-side writers POST here with `X-Internal-Key` +
`X-Internal-User-Id`. The route trusts the payload's agent_id but
validates that the agent exists and that the resolved user can
access it.

## Request body

- MemoryCreate: Internal write payload (X-Internal-Key auth path). Used by skill callbacks and other server-side writers. User-facing writes happen via /workspace/MEMORY.md (indexed by memory_file_sync), not this endpoint directly.
  - `agent_id` string, uuid, required
  - `user_id` string, uuid, nullable
  - `text` string, required
  - `kind` 'preference' | 'fact' | 'instruction' | 'observation' | 'skill_outcome'
  - `source` 'chat_user_explicit' | 'chat_inferred' | 'heartbeat' | 'admin' | 'skill' | 'memory_md' | 'memory_dir'
  - `source_message_id` string, uuid, nullable
  - `confidence` number
  - `pinned` boolean

## Response `200`

Successful Response

- MemoryItem: A single memory row — what list/detail endpoints return.
  - `id` string, uuid, required
  - `agent_id` string, uuid, required
  - `user_id` string, uuid, nullable, required
  - `text` string, required
  - `kind` 'preference' | 'fact' | 'instruction' | 'observation' | 'skill_outcome', required
  - `source` 'chat_user_explicit' | 'chat_inferred' | 'heartbeat' | 'admin' | 'skill' | 'memory_md' | 'memory_dir', required
  - `source_message_id` string, uuid, nullable, required
  - `confidence` number, required
  - `pinned` boolean, required
  - `hit_count` integer, required
  - `last_recalled_at` string, date-time, nullable, required
  - `expires_at` string, date-time, nullable, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/tintin-x/apis/tintin-api.md) · [All operations](https://skmtc.dev/tintin-x/apis/tintin-api/llms.txt) · [OpenAPI document](https://skmtc.dev/tintin-x/apis/tintin-api/revisions/8839a8d0a66c?raw)
