---
title: "Save a team memory"
method: POST
path: "/v1/teams/{teamId}/memories"
tags: ["Teams"]
---

# Save a team memory

`POST /v1/teams/{teamId}/memories`

## Request

- Base URL: `https://api.spacefast.com`
- URL: `https://api.spacefast.com/v1/teams/{teamId}/memories`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://api.spacefast.com/v1/auth/oauth2/authorize`, token URL `https://api.spacefast.com/v1/auth/oauth2/token`; client credentials, token URL `https://api.spacefast.com/v1/auth/oauth2/token`, scopes: `spaces:write`)

Saves one lasting fact, decision, or preference so every agent on the team reads it next time. Save a memory only when the user requests or agrees to saving it, for a preference, correction, or decision that a future agent could not read from the site files, the Space settings, or the API. Do not save task progress, to-dos, file paths, build output, or one-time instructions, and do not save at every step. Write one fact per memory: a short title, a body of one to three sentences that includes the reason (who asked, or what caused it), and a category. Set `spaceId` only when the fact is about one Space. Never save passwords, API keys, tokens, payment details, or private contact details: name the service, not its credential. Text that looks like a credential is refused with `team_memory_contains_credential`; rephrase it rather than retry. If an active memory in the same scope already has this title, ignoring case, the call fails with `team_memory_exists` and `details.memoryId`: update that memory with `updateTeamMemory` instead, and archive a wrong one rather than saving a second, contradicting memory. A team keeps at most 200 active memories. A save changes `memories.revision`, so your next `getTeamAgentContext` read returns every memory again. After you save, tell the user in one line what you saved.

## Path parameters

- `teamId` string, required

## Request body

- object
  - `title` string, required: Short title. Unique among the team's active memories in the same scope, ignoring case.
  - `body` string, required: One fact, decision, or preference in one to three sentences, with the reason.
  - `category` 'brand' | 'voice' | 'audience' | 'design' | 'decision' | 'convention' | 'preference' | 'fact', required: What kind of knowledge the memory holds.
  - `spaceId` string: Set when the memory is about one Space. Omit it for the whole team.
  - `pinned` boolean: Pin the memory. Keep pinned memories to a handful.

## Response `201`

Response for status 201

- object
  - `$schema` string, uri: Canonical JSON Schema URL for this response body. The server also sends it in the `Link: rel="describedby"` response header.
  - `data` object, required
    - `id` string, required
    - `teamId` string, required: Team the memory belongs to.
    - `spaceId` string, nullable, required: The Space the memory is about, or null for the whole team.
    - `category` 'brand' | 'voice' | 'audience' | 'design' | 'decision' | 'convention' | 'preference' | 'fact', required: What kind of knowledge the memory holds.
    - `title` string, required: Short title. Unique among the team's active memories in the same scope, ignoring case.
    - `body` string, required: One fact, decision, or preference in one to three sentences, with the reason.
    - `pinned` boolean, required: Pinned memories come first in every agent-context read.
    - `archivedAt` string, date-time, nullable, required: When the memory was archived, or null while it is active.
    - `createdBy` object, required: Who wrote the memory.
      - `type` 'person' | 'agent' | 'api_key' | 'system', required: person: a signed-in member. agent: an OAuth agent connection.
      - `userId` string, nullable, required: The person, or the person who connected the agent.
      - `connectionId` string, nullable, required: The agent connection (grant) that wrote it, for agent writes.
      - `name` string, nullable, required: Display name: the person, agent, or API key.
    - `updatedBy` object, required: Who wrote the memory.
      - `type` 'person' | 'agent' | 'api_key' | 'system', required: person: a signed-in member. agent: an OAuth agent connection.
      - `userId` string, nullable, required: The person, or the person who connected the agent.
      - `connectionId` string, nullable, required: The agent connection (grant) that wrote it, for agent writes.
      - `name` string, nullable, required: Display name: the person, agent, or API key.
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required

## Other responses

- `default`: Problem details (RFC 9457). Any 4xx/5xx response is one `application/problem+json` document.

---

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