POST
/
api
/
project
/
{projectId}
/
integration
/
api
/
session
/
search
Search Sessions
curl --request POST \
  --url https://app.pathors.com/api/project/{projectId}/integration/api/session/search \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '{
  "search_string": "<string>",
  "limit": 123,
  "offset": 123
}'
{
  "results": [
    {
      "sessionId": "<string>",
      "data": {},
      "createdAt": "<string>",
      "updatedAt": "<string>"
    }
  ],
  "pagination": {
    "limit": 123,
    "offset": 123,
    "total": 123
  }
}
Search across all sessions to find matches based on string content in session data.

Search Sessions

POST /api/project/{projectId}/integration/api/session/search

Path Parameters

projectId
string
required
The ID of your project

Request Headers

Authorization
string
required
Bearer token authentication using your API key

Request Body

search_string
string
required
The string to search for in session data. This will match against all session content including variables, messages, and other stored information.
limit
number
Maximum number of results to return. Default: 50
offset
number
Number of results to skip for pagination. Default: 0

Response

results
array
Array of matching sessions, ordered by most recently updated first
pagination
object
Pagination information

Example

Request

curl -X POST https://app.pathors.com/api/project/{projectId}/integration/api/session/search \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "search_string": "John Doe",
    "limit": 10,
    "offset": 0
  }'

Response

{
  "results": [
    {
      "sessionId": "user-123-session-456",
      "data": {
        "variables": {
          "userName": "John Doe",
          "userRole": "admin"
        },
        "messages": [
          {
            "role": "user",
            "content": "Hello"
          },
          {
            "role": "assistant",
            "content": "Hi John Doe! How can I help you today?"
          }
        ]
      },
      "createdAt": "2024-01-15T10:30:00.000Z",
      "updatedAt": "2024-01-15T10:35:00.000Z"
    },
    {
      "sessionId": "user-456-session-789",
      "data": {
        "variables": {
          "userName": "John Doe",
          "userRole": "user"
        },
        "messages": []
      },
      "createdAt": "2024-01-14T15:20:00.000Z",
      "updatedAt": "2024-01-14T15:25:00.000Z"
    }
  ],
  "pagination": {
    "limit": 10,
    "offset": 0,
    "total": 2
  }
}

Usage Notes

  • Search String: The search is case-sensitive and matches against the entire JSON content of the session data
  • Ordering: Results are ordered by updatedAt in descending order (most recent first)
  • Pagination: Use limit and offset to paginate through large result sets
  • Performance: For large datasets, consider using more specific search strings to improve query performance

Error Responses

Status CodeDescription
400Missing or invalid search_string
401Invalid authentication
500Internal server error
Example error responses: 400 Bad Request:
{
  "error": "search_string is required"
}
401 Unauthorized:
{
  "error": {
    "message": "Invalid authentication"
  }
}