Skip to main content
POST
/
contexts
Save conversation context
curl --request POST \
  --url https://apigcp.trynia.ai/v2/contexts \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "title": "<string>",
  "summary": "<string>",
  "content": "<string>",
  "agent_source": "<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>"
    }
  ],
  "workspace_override": "<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>"
    }
  ]
}

Authorizations

Authorization
string
header
required

API key must be provided in the Authorization header

Body

application/json
title
string
required

Descriptive title for the context

Required string length: 1 - 200
summary
string
required

Brief summary of the conversation

Required string length: 10 - 1000
content
string
required

Full conversation context

Minimum length: 50
agent_source
string
required

Which agent is creating this context (e.g., "cursor", "claude-code")

tags
string[]

Searchable tags for categorization

metadata
object

Optional metadata like file paths, repositories discussed, etc.

nia_references
object

References to NIA resources used during the conversation

edited_files
object[]

List of files that were modified during conversation

workspace_override
string

Optional custom workspace name (overrides auto-detection)

Response

Context saved 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[]