---
title: "Rename, share or move a chat (creator only), or pin it for yourself (anyone who can read it)"
method: PATCH
path: "/agents/sessions/{session_id}"
tags: ["AI", "Agents"]
---

# Rename, share or move a chat (creator only), or pin it for yourself (anyone who can read it)

`PATCH /agents/sessions/{session_id}`

## Request

- Base URL: `https://app.mammoth.io/api/v2`
- URL: `https://app.mammoth.io/api/v2/agents/sessions/{session_id}`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-KEY` and API key in header `X-API-SECRET` and API key in header `X-WORKSPACE-ID`

Body: any of `visibility`, `title`, `pinned`, `project_id` / `project_scope` (400 for none). A title is whitespace-collapsed and 1-80 characters; a renamed chat keeps its title (no generated title replaces it) and its place in the list. `pinned` is the caller's own pin. A `project_id` moves the chat to a project the owner can read; `project_scope: "all"` moves it to all projects.

## Path parameters

- `session_id` string, required

## Request body

- UpdateSessionRequest
  - `visibility` 'private' | 'shared' | 'null', nullable
  - `title` string, nullable
  - `pinned` boolean, nullable
  - `project_id` integer, nullable
  - `project_scope` 'project' | 'all' | 'null', nullable

## Response `200`

Request fulfilled, document follows

- AgentSessionSummary
  - `session_id` string, required
  - `agent_key` string, required
  - `scope_type` string, required
  - `scope_id` integer, nullable
  - `title` string, nullable
  - `status` string, required
  - `visibility` 'private' | 'shared', required
  - `owner_user_id` integer, required
  - `is_owner` boolean, required
  - `project_scope` string, nullable
  - `project_id` integer, nullable
  - `workflow_id` integer, nullable
  - `scope` AgentObjectScope
    - `kind` 'workflow' | 'dataset', required
    - `id` integer, required
    - `name` string, nullable
    - `project_id` integer, nullable
  - `object_chat` AgentObjectChat
    - `kind` 'workflow' | 'view' | 'dataset' | 'automation' | 'automations' | 'lineage', required
    - `id` integer, required
    - `name` string, nullable
    - `project_id` integer, nullable
    - `dataset_id` integer, nullable
    - `dataset_name` string, nullable
  - `created_at` string, nullable
  - `last_active_at` string, nullable
  - `attention` 'question' | 'approval' | 'stopped' | 'failed' | 'new_result' | 'waiting_job' | 'waiting_time' | 'paused' | 'capped' | 'null', nullable
  - `unseen` boolean
  - `needs_you` boolean
  - `made` AgentSessionMade
    - `kind` string, required
    - `id` union, required
      - integer
      - string
    - `name` string, required
  - `match` AgentSessionMatch
    - `field` 'title' | 'message' | 'made', required
    - `snippet` string, required
  - `pinned_at` string, nullable
  - `title_source` 'auto' | 'result' | 'user' | 'null', nullable

## Other responses

- `400`: Bad request syntax or unsupported method
- `403`: Request forbidden -- authorization will not help

---

[API](https://skmtc.dev/mammoth/apis/mammoth-analytics.md) · [All operations](https://skmtc.dev/mammoth/apis/mammoth-analytics/llms.txt) · [OpenAPI document](https://skmtc.dev/mammoth/apis/mammoth-analytics/revisions/4b2c943a00dc?raw)
