Sessions API
Organize multi-step research workflows with automatic URL deduplication, credit tracking, and context inheritance.
Lifecycle: active → completed → archived
Credits: Same as individual operations (search/crawl)
GET /api/v1/sessions
List sessions with pagination and filtering.
Query Parameters:
limit(Int) - Results per page (1-100)offset(Int) - Pagination offsetstatus(String) - Filter by statustag(String) - Filter by tagdays_back(Int) - Filter by recencyinclude_shared(Bool) - Include org-shared sessions from teammates
Response with include_shared=true:
{
"sessions": [...],
"shared_sessions": [...],
"user_organizations": [{"id": "...", "name": "..."}],
"pagination": {
"owned": {"total": 10, "limit": 10, "offset": 0},
"shared": {"total": 5, "limit": 10, "offset": 0}
}
}
POST /api/v1/sessions
Create a new session.
| Parameter | Type | Default | Description |
|---|---|---|---|
name | String | required | Session name (max 255 chars) |
description | String | - | Optional description |
intent_context | String | - | Research intent guiding AI features |
session_config.auto_deduplicate | Bool | true | Auto-remove duplicate URLs |
session_config.accumulate_context | Bool | true | Build context from previous operations |
session_config.use_session_context | Bool | true | Use context for AI features |
session_config.max_operations | Int | - | Operation limit (1-100) |
metadata.intent.type | String | - | competitive_analysis, due_diligence, technical_evaluation, market_research, academic_research, news_monitoring, lead_generation |
Limits: 100 sessions/user, 1-100 operations/session, auto-archive after 7 days
GET /api/v1/sessions/{id}
Get session details including operations, context_summary, and access level.
Response includes:
access_level- Your access level:owner,org_viewer, orpublicorganization_name- Organization name if shared with an orguser_organizations- Your organizations (for sharing UI)
PATCH /api/v1/sessions/{id}
Update session properties: name, description, intent_context, config.
DELETE /api/v1/sessions/{id}
Delete session and all associated operations (permanent).
POST /api/v1/sessions/{id}/complete
Mark session as completed. Prevents new operations from being added.
POST /api/v1/sessions/{id}/archive
Archive a completed session. Session must be completed first.
POST /api/v1/sessions/{id}/share
Toggle public or organization sharing for a session.
Body Parameters:
| Parameter | Type | Description |
|---|---|---|
public_share | Bool | Enable/disable public sharing |
shared_with_org | Bool | Enable/disable organization sharing |
organization_id | String | Target organization (required when shared_with_org=true) |
Cascade Behavior: When org sharing is changed, all child operations (search jobs and crawls) in the session are automatically updated to match.
Example:
# Share with organization
curl -X POST https://www.zipf.ai/api/v1/sessions/SESSION_ID/share \
-H "Authorization: Bearer wvr_TOKEN" \
-d '{"shared_with_org": true, "organization_id": "ORG_ID"}'
# Response includes operations updated
{
"session": {...},
"operations_updated": {
"org_share": {"searches": 3, "crawls": 2}
}
}
GET /api/v1/sessions/{id}/timeline
Get chronological timeline of all session operations with status, results, and credits.
GET /api/v1/sessions/{id}/export
Export session data.
Query Parameters:
format(String) - Export format:jsonorcsv
GET /api/v1/sessions/{id}/link-graph
Get aggregated link graph across all crawls in a session. Includes cumulative PageRank, domain authority, and HITS analysis. Cost: FREE
Query Parameters:
| Parameter | Default | Description |
|---|---|---|
include_nodes | true | Include node data in response |
include_edges | false | Include edge data (can be large) |
node_limit | 100 | Max nodes to return (1-1000) |
sort_by | pagerank | Sort nodes by: pagerank, inlinks, authority, hub |
min_importance | 0 | Filter nodes by minimum PageRank score |
metadata_only | false | Return only cached stats (faster) |
Response:
{
"session_id": "uuid",
"link_graph": {
"stats": {
"total_nodes": 500,
"total_edges": 1200,
"operations_included": 3,
"total_pages_crawled": 45
},
"domain_authority": {"example.com": 0.85},
"hubs": [{"url": "...", "score": 0.18}],
"authorities": [{"url": "...", "score": 0.25}],
"nodes": [{"url": "...", "pagerank": 0.05, "inlinks": 10}],
"last_updated": "2026-01-27T12:00:00Z"
}
}
See Crawl API - Link Graph for detailed documentation.
POST /api/v1/sessions/{id}/search
Search within a session context. Same parameters as POST /api/v1/search plus:
filter_seen_urls(Bool, default: false) - Exclude URLs already in session
POST /api/v1/sessions/{id}/crawl
Crawl within a session context. Same parameters as POST /api/v1/crawls plus:
filter_seen_urls(Bool, default: true) - Exclude URLs already in session
GET /api/v1/public/sessions/{id}
View a publicly shared session (no authentication required).
GET /api/v1/public/sessions/{id}/timeline
View public session timeline (no authentication required).
GET /api/v1/public/sessions/{id}/export
Export public session data (no authentication required).
Organization Sharing
Share sessions with your organization's team members for collaborative research workflows.
Access Levels
| Level | Description | Permissions |
|---|---|---|
owner | Created the session | Full access (read, write, delete) |
org_viewer | Organization member | Read-only access |
public | Public link access | Read-only access |
Cascade Behavior
When you share a session with your organization:
- All child operations (search jobs and crawls) are automatically shared
- Child operations inherit the session's organization and sharing status
- Removing org sharing from a session removes it from all children
Workflow Integration
Workflows with linked sessions cascade org sharing:
- Sharing a workflow shares its linked session
- Session cascade then shares all child operations
- Consistent access across the entire workflow pipeline
Session Context for AI Features
When use_session_context: true, AI features receive accumulated context:
| Data Type | Used For |
|---|---|
| Research Intent | Priority guidance for all AI features |
| Recent Queries | Query refinement, theme continuity |
| Document/Content Types | Preferred format detection |
| Domain Frequency | Novelty scoring, source diversity |
| Entities & Keywords | Research theme identification |
Intent Types & Effects
| Intent Type | Query Additions | Reranking Boost |
|---|---|---|
competitive_analysis | "vs", "comparison" | +20% news, analyst reports |
due_diligence | "risks", "financials" | +20% legal, regulatory |
technical_evaluation | "benchmarks", "specs" | +20% documentation |
academic_research | "research", "paper" | +20% academic writing |
Reranking Boosts
- Authority Alignment (1.25x): Based on
authority_preference(academic/news/technical) - Document Type (1.15x): Matching
dominant_document_types - Novelty Scoring:
novelty = exp(-0.15 × domain_count)
URL Deduplication vs Novelty Reranking
| Aspect | filter_seen_urls=true | rerank_results=true |
|---|---|---|
| Type | Hard filter | Soft penalty |
| Timing | Before results | During reranking |
| Visibility | URLs hidden | URLs deprioritized |
| Scope | Exact URL only | URLs + domain frequency |
| Credits | No extra cost | Triggers advanced (2 credits) |
Example
# Create session
curl -X POST https://www.zipf.ai/api/v1/sessions \
-H "Authorization: Bearer wvr_TOKEN" \
-d '{"name": "AI Research", "intent_context": "Competitive analysis", "session_config": {"auto_deduplicate": true}}'
# Search in session
curl -X POST https://www.zipf.ai/api/v1/sessions/SESSION_ID/search \
-H "Authorization: Bearer wvr_TOKEN" \
-d '{"query": "AI startups", "filter_seen_urls": true}'
# Share with organization (cascades to all operations)
curl -X POST https://www.zipf.ai/api/v1/sessions/SESSION_ID/share \
-H "Authorization: Bearer wvr_TOKEN" \
-d '{"shared_with_org": true, "organization_id": "ORG_ID"}'
# List including shared sessions
curl https://www.zipf.ai/api/v1/sessions?include_shared=true \
-H "Authorization: Bearer wvr_TOKEN"