alterlab_create_session
Create a reusable authenticated scraping session by storing browser login cookies, so scrapes can access login-walled pages. Requires explicit consent; returns a session_id for reuse.
Instructions
Create a new stored session for authenticated scraping. Provide cookies from a logged-in browser session to enable scraping behind login walls. The session is stored securely and can be reused across multiple scrape requests via session_id. Requires consent=true (explicit GDPR consent to store the cookies); optional headers, expires_at, notes, auto_refresh/notification flags and organization sharing are supported.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Human-readable name for this session (e.g., 'My Amazon Account') | |
| notes | No | Free-text notes about this session | |
| domain | Yes | Domain this session is for (e.g., 'amazon.com') | |
| shared | No | Share the session with organization members immediately (API default false) | |
| consent | Yes | Explicit GDPR consent from the account owner to store these session cookies. Must be true — the API rejects session creation with CONSENT_REQUIRED otherwise. Only set true after the user has agreed to AlterLab storing their cookies. | |
| cookies | No | Cookies for authentication. Cookies as a {name: value} object (e.g. {"session-id": "abc123"}) or as a list (max 100) of cookie objects with metadata: {name, value, domain?, path?, secure?, httpOnly?, sameSite?, expires?}. | |
| headers | No | Custom headers sent with this session (e.g., a User-Agent or Authorization header) | |
| expires_at | No | Session expiry in ISO 8601 format (e.g., '2026-12-31T23:59:59Z') | |
| organization_id | No | Organization to assign the session to (org admins only) | |
| notify_on_failure | No | Notify when session validation fails (API default true) | |
| auto_refresh_enabled | No | Enable proactive expiry detection and health checks (API default true) | |
| notify_before_expiry | No | Notify when the session is about to expire (API default true) |