Skip to main content
GET
/
contexts
List contexts
curl --request GET \
  --url https://apigcp.trynia.ai/v2/contexts \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://apigcp.trynia.ai/v2/contexts"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://apigcp.trynia.ai/v2/contexts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://apigcp.trynia.ai/v2/contexts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://apigcp.trynia.ai/v2/contexts"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://apigcp.trynia.ai/v2/contexts")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://apigcp.trynia.ai/v2/contexts")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "pagination": {
    "total": 123,
    "limit": 123,
    "offset": 123,
    "has_more": true
  },
  "total": 123,
  "items": [
    {}
  ],
  "contexts": [
    {}
  ]
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

Authorizations

Authorization
string
header
required

API key must be provided in the Authorization header

Query Parameters

limit
integer
default:20

Number of contexts to return

Required range: 1 <= x <= 100
offset
integer
default:0

Number of contexts to skip

Required range: x >= 0
tags
string | null

Comma-separated tags to filter by

agent_source
string | null

Filter by agent source

memory_type
string | null

Filter by memory type: scratchpad, episodic, fact, procedural

Response

Successful Response

Backwards-compatible context list response.

pagination
PaginationInfo · object
required

Pagination metadata

total
integer
required

Legacy total count

items
Items · object[]

List of contexts

contexts
Contexts · object[]

Legacy contexts list