Session Management
How Sessions Work
import requests
import uuid
API_BASE = "https://api.tomatopy.pizza/v1"
HEADERS = {
"Content-Type": "application/json",
"X-API-Key": "your-api-key",
"X-Session-ID": str(uuid.uuid4()) # New session
}
# This request creates the session and a tomato within it
response = requests.post(f"{API_BASE}/tomato/acquire", headers=HEADERS, json={
"variety": "San Marzano",
"ripeness": 0.8,
"weight": 150
})
tomato = response.json()The X-Session-ID Header
Object Tracking Within a Session
Prefix
Type
Created By
Debug Endpoint
GET /v1/session/{session_id}/log
Session Lifecycle
Error Handling
Best Practices
Endpoint Reference
Endpoint
Method
Description
Next Steps
Last updated
Was this helpful?