REST API v1
Base URL: https://mailsaas.searchpilot.store/api/v1
Authentication
Create a key in Workspace → API Keys (plans with API access). Send it as a bearer token. Keys are scoped (contacts:read, contacts:write, campaigns:read, campaigns:write, automations:read, automations:write, account:read) and belong to one workspace.
Rate limits
Per-key limit per minute (default 60). Every response includes X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset. Exceeding it returns 429 with Retry-After.
Idempotency
Send an Idempotency-Key header on POST requests. Retrying with the same key and body returns the original response (Idempotent-Replayed: true); a different body returns 422.
Errors
401 missing/invalid key · 403 scope or plan does not allow the action · 404 not found (including resources of other workspaces) · 409 conflict · 422 validation · 429 rate limited.
Contacts
/contactscontacts:readList contacts. Query: page, per_page (≤100), email, status.
/contactscontacts:writeCreate a contact. consent is required: opt_in (you already hold permission) or double_opt_in (we email a confirmation link; status stays pending). Set upsert: true to update an existing contact. Existing unsubscribed/bounced contacts are never re-subscribed via the API.
/contacts/{id}contacts:readRetrieve a contact.
/contacts/{id}contacts:writeUpdate fields, lists and tags. status may only be set to unsubscribed.
/contacts/{id}contacts:writeDelete a contact.
Campaigns
/campaignscampaigns:readList campaigns. Query: page, per_page, status.
/campaignscampaigns:writeCreate a draft campaign. HTML is sanitized and merge tags validated.
/campaigns/{id}campaigns:readRetrieve a campaign including HTML.
/campaigns/{id}/sendcampaigns:writeValidate and queue (or schedule with scheduled_at, UTC). Sending happens in background workers. Repeated calls cannot send twice (409).
Reports
/reports/{campaign_id}campaigns:readCampaign statistics. Opens are approximate.
Automations
/automationsautomations:readList workflows.
/automationsautomations:writeCreate a linear workflow (use the visual builder for branches). Step types: send_email, add_tag, remove_tag, add_to_list, remove_from_list, update_contact, wait.
/eventscontacts:writeFire an API-event trigger for a contact. Optional event_id deduplicates repeated deliveries.
Account
/account/creditsaccount:readWallet balance and subscription.
Outbound webhooks
Configure endpoints in Workspace → Webhooks. Events: email.delivered, email.bounce, email.complaint, email.open, email.click, email.unsubscribe, campaign.completed, contact.created. Verify X-Signature: t=TIMESTAMP,v1=SIGNATURE where SIGNATURE = hex HMAC-SHA256 of TIMESTAMP + "." + raw_body using your endpoint secret.