Endpoint
Description
Submits a new task to Shannon for execution. The task is queued immediately and processed asynchronously by the Temporal workflow engine.Authentication
Required: Yes Include API key in header:Request
Headers
Body Parameters
Request Body Schema
Example 1: General AI-powered executionContext Parameters (context.*)
Recognized keys:
role— role preset (e.g.,analysis,research,writer,ads_research,financial_news,browser_use)system_prompt— overrides role prompt; supports${var}fromprompt_paramsprompt_params— arbitrary parameters for prompts/tools/adaptersmodel_tier— fallback when top‑level not providedmodel_override— specific model name (canonical; e.g.,gpt-5,claude-sonnet-4-5-20250929)provider_override— force provider (e.g.,openai,anthropic,google)research_strategy— (deprecated: use top-levelresearch_strategyinstead; context value is ignored when top-level is set)skill— (deprecated: use top-levelskillinstead; context value is ignored when top-level is set)template— template name (alias:template_name)template_version— template versiondisable_ai— template-only mode (no AI fallback) - cannot be combined with model controls- Window controls:
history_window_size,use_case_preset,primers_count,recents_count,compression_trigger_ratio,compression_target_ratio - Deep Research 2.0 controls (when
force_research: true):iterative_research_enabled— Enable/disable iterative coverage loop (default:true)iterative_max_iterations— Max iterations 1-5 (strategy presets seed defaults; otherwise falls back to3)enable_fact_extraction— Extract structured facts into metadata (default:false)
- Ads Research Platform Toggles (when
role: "ads_research"):platforms.google— Enable/disable Google Shopping Ads (default:true)platforms.yahoo_jp— Enable/disable Yahoo Japan Ads (default:true)platforms.meta— Enable/disable Meta Ad Library (default:true)platforms.meta_platform— Meta platform filter:facebook,instagram,messenger,whatsapp, orall(default:all)
- Top-level parameters override context equivalents:
model_tier,model_override,provider_override,skill,research_strategy modesupports:simple|standard|complex|supervisor(default: auto-detect)model_tiersupports:small|medium|large- Conflict validation:
disable_ai: truecannot be combined withmodel_tier,model_override, orprovider_override(returns 400)
Role Presets
Role presets provide specialized system prompts and tool allowlists for different task types. Set viacontext.role:
Shannon Cloud Only: Roles marked as “Shannon Cloud Only” are enterprise features and require a Shannon Cloud deployment with vendor adapter configuration.
Response
Success Response
Status:200 OK
Headers:
X-Workflow-ID: Temporal workflow identifierX-Session-ID: Session identifier (auto-generated if not provided)
Response Fields
Examples
Basic Task Submission
Task with Session ID (Multi-Turn)
Task with Context
Force Tier (Top‑Level)
Template‑Only Execution
Supervisor Mode
Ads Research (Shannon Cloud Only)
Multi-platform advertising competitor analysis with platform toggles.Deep Research 2.0
Deep Research 2.0 provides iterative coverage improvement for comprehensive research tasks.With Idempotency
With Distributed Tracing
Error Responses
400 Bad Request
Missing Query:401 Unauthorized
Missing API Key:429 Too Many Requests
X-RateLimit-Limit: 100X-RateLimit-Remaining: 0X-RateLimit-Reset: 1609459200Retry-After: 60
500 Internal Server Error
Code Examples
Python with httpx
Python with requests
JavaScript/Node.js
cURL with Idempotency
Go
Implementation Details
Workflow Creation
When you submit a task:- Gateway receives request → Validates authentication, rate limits
- Generates session ID → If not provided, auto-generates UUID
- Calls Orchestrator gRPC →
SubmitTask(metadata, query, context) - Orchestrator starts Temporal workflow → Durable execution
- Response returned → Task ID, initial status
- Task executes asynchronously → Independent of HTTP connection
Idempotency Behavior
Idempotency keys allow safe retries of task submissions without creating duplicate tasks. How it works:-
First request with an
Idempotency-Key:- Shannon creates the task
- Caches the response in Redis with 24-hour TTL
- Returns task ID and status
-
Duplicate requests (same
Idempotency-Key):- Shannon detects the cached response
- Returns the same task ID without creating a new task
- Response is identical to the first request
-
After 24 hours:
- Cache expires
- New request with same key creates a new task
- Storage: Redis
- TTL: 24 hours (86400 seconds)
- Key format:
idempotency:<16-char-hash>(SHA-256 of the idempotency key plus user ID, path, and request body) - Scope: Per authenticated user (user ID is part of the hash; when auth is disabled the hash is based on the header, path, and body)
- Cached responses: Only 2xx responses are stored; cached hits include
X-Idempotency-Cached: trueandX-Idempotency-Key: <your-key>
- Network retry logic (avoid duplicate tasks on timeout)
- Webhook deliveries (handle duplicate webhook calls)
- Critical operations (payments, data writes)
- Background job queues (prevent duplicate scheduling)
Session Management
- No session_id: Auto-generates UUID, fresh context
- With session_id: Loads previous conversation history from Redis
- Session persistence: 30 days default TTL
- Multi-turn conversations: All tasks with same
session_idshare context
Context Object
Thecontext object is stored as metadata and passed to:
- Agent execution environment
- Tool invocations (can access via
ctx.get("key")) - Session memory (for reference in future turns)
- User preferences:
{"language": "spanish", "format": "markdown"} - Business context:
{"company_id": "acme", "department": "sales"} - Constraints:
{"max_length": 500, "tone": "formal"}
Best Practices
1. Always Use Idempotency Keys for Critical Tasks
2. Use Sessions for Conversations
3. Provide Rich Context
4. Handle Errors Gracefully
5. Store Task IDs for Tracking
Submit + Stream in One Call
Related Endpoints
Submit + Stream
POST /api/v1/tasks/stream (recommended for UIs)
Get Task Status
GET /api/v1/tasks/
Stream Events
Real-time task events
List Tasks
GET /api/v1/tasks
Python SDK
Use the SDK instead