Skip to main content
PUT
/
contexts
/
{context_id}
Update conversation context
curl --request PUT \
  --url https://apigcp.trynia.ai/v2/contexts/{context_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "<string>",
  "summary": "<string>",
  "content": "<string>",
  "tags": [
    "<string>"
  ],
  "metadata": {},
  "nia_references": {
    "indexed_repositories": [
      "<string>"
    ],
    "indexed_documentation": [
      "<string>"
    ],
    "queried_repositories": [
      "<string>"
    ],
    "queried_documentation": [
      "<string>"
    ],
    "web_searches": [
      "<string>"
    ],
    "deep_research_queries": [
      "<string>"
    ]
  },
  "edited_files": [
    {
      "file_path": "<string>",
      "operation": "created",
      "lines_added": 123,
      "lines_removed": 123,
      "language": "<string>"
    }
  ],
  "memory_type": "scratchpad",
  "ttl_seconds": 1,
  "lineage": {
    "source_ids": [
      "<string>"
    ],
    "confidence": 0.5,
    "derived_from": [
      "<string>"
    ],
    "tool_calls": [
      "<string>"
    ],
    "model_version": "<string>"
  }
}
'
{
  "id": "<string>",
  "user_id": "<string>",
  "organization_id": "<string>",
  "title": "<string>",
  "summary": "<string>",
  "content": "<string>",
  "tags": [
    "<string>"
  ],
  "agent_source": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "metadata": {},
  "nia_references": {
    "indexed_repositories": [
      "<string>"
    ],
    "indexed_documentation": [
      "<string>"
    ],
    "queried_repositories": [
      "<string>"
    ],
    "queried_documentation": [
      "<string>"
    ],
    "web_searches": [
      "<string>"
    ],
    "deep_research_queries": [
      "<string>"
    ]
  },
  "edited_files": [
    {
      "file_path": "<string>",
      "operation": "created",
      "lines_added": 123,
      "lines_removed": 123,
      "language": "<string>"
    }
  ],
  "memory_type": "scratchpad",
  "expires_at": "2023-11-07T05:31:56Z",
  "lineage": {
    "created_at": "2023-11-07T05:31:56Z",
    "source_ids": [
      "<string>"
    ],
    "confidence": 0.5,
    "derived_from": [
      "<string>"
    ],
    "tool_calls": [
      "<string>"
    ],
    "model_version": "<string>"
  }
}

Authorizations

Authorization
string
header
required

API key must be provided in the Authorization header

Path Parameters

context_id
string
required

Unique context identifier

Body

application/json

Request to update an existing context (all fields optional)

title
string
Required string length: 1 - 200
summary
string
Required string length: 10 - 1000
content
string
Minimum string length: 50
tags
string[]
metadata
object
nia_references
object

References to NIA resources used during the conversation

edited_files
object[]
memory_type
enum<string>

Memory taxonomy type:

  • scratchpad: Temporary working memory (1hr TTL)
  • episodic: Session summaries (7d TTL)
  • fact: Atomic factual statements (permanent)
  • procedural: Tool/function definitions (permanent)
Available options:
scratchpad,
episodic,
fact,
procedural
ttl_seconds
integer | null

Custom TTL in seconds

Required range: x >= 0
lineage
object

Provenance tracking input for content artifacts

Response

Context updated successfully

id
string

Unique identifier for the context

user_id
string

User who created the context

organization_id
string

Organization ID if context belongs to an organization

title
string

Context title

summary
string

Context summary

content
string

Full context content

tags
string[]
agent_source
string

Source agent (e.g., "cursor", "claude-code")

created_at
string<date-time>

When the context was created

updated_at
string<date-time>

When the context was last updated

metadata
object
nia_references
object

References to NIA resources used during the conversation

edited_files
object[]
memory_type
enum<string>

Memory taxonomy type:

  • scratchpad: Temporary working memory (1hr TTL)
  • episodic: Session summaries (7d TTL)
  • fact: Atomic factual statements (permanent)
  • procedural: Tool/function definitions (permanent)
Available options:
scratchpad,
episodic,
fact,
procedural
expires_at
string<date-time> | null

When this context will expire (null for permanent memory types)

lineage
object

Provenance tracking metadata for content artifacts