API reference
API reference
Every Pidgely endpoint, generated from the OpenAPI 3.1 document, with parameters, request examples in six languages, responses and errors.
The Pidgely API is a JSON REST API at https://api.pidgely.com. Every page in this section is generated at build time from the OpenAPI 3.1 document (also as JSON), so it always matches the deployed contract.
- Authentication:
Authorization: Bearer pdg_…(Authentication) - Errors:
{"statusCode", "name", "message"}(Errors) - Lists:
limit,after,before→{"object": "list", "has_more", "data"}(Pagination) - Retries:
Idempotency-Keyon sends (Idempotency) - Timestamps:
YYYY-MM-DD HH:MM:SS.ffffff+00in UTC
Request examples show the call in each official SDK (Node.js, Python, PHP, Go, Ruby; preview) and the raw request in cURL.
The native API (/v1/…) predates the main routes and is documented for completeness (cURL examples only); prefer the main endpoints and the SDKs for new code. Dashboard (cookie session) and operator endpoints are internal and not covered here.
Emails
| Endpoint | Description |
|---|---|
POST /emails |
Send an email |
POST /emails/batch |
Send a batch of emails |
GET /emails |
List emails |
GET /emails/{id} |
Retrieve an email |
PATCH /emails/{id} |
Reschedule an email |
POST /emails/{id}/cancel |
Cancel a scheduled email |
GET /emails/{id}/events |
List the events of an email |
GET /emails/{email_id}/attachments |
List an email's attachments |
GET /emails/{email_id}/attachments/{id} |
Retrieve an attachment |
Domains
| Endpoint | Description |
|---|---|
POST /domains |
Create a domain |
GET /domains |
List domains |
GET /domains/{id} |
Retrieve a domain |
PATCH /domains/{id} |
Update a domain |
DELETE /domains/{id} |
Delete a domain |
POST /domains/{id}/verify |
Verify a domain's DNS records |
GET /domains/{id}/dns-provider |
Detect a domain's DNS provider |
POST /domains/{id}/dns-provider/cloudflare |
Set up DNS with Cloudflare |
API keys
| Endpoint | Description |
|---|---|
POST /api-keys |
Create an API key |
GET /api-keys |
List API keys |
PATCH /api-keys/{id} |
Update an API key |
DELETE /api-keys/{id} |
Delete an API key |
Webhooks
| Endpoint | Description |
|---|---|
POST /webhooks |
Create a webhook |
GET /webhooks |
List webhooks |
GET /webhooks/{id} |
Retrieve a webhook |
PATCH /webhooks/{id} |
Update a webhook |
DELETE /webhooks/{id} |
Delete a webhook |
POST /webhooks/{id}/signing-secret/rotate |
Rotate a signing secret |
Metrics
| Endpoint | Description |
|---|---|
GET /metrics |
Retrieve metrics |
GET /metrics/links |
List clicks per link |
Templates
| Endpoint | Description |
|---|---|
POST /templates |
Create a template |
GET /templates |
List templates |
GET /templates/{key} |
Retrieve a template (draft) |
PATCH /templates/{key} |
Update a template draft |
DELETE /templates/{key} |
Delete a template |
GET /brand |
Get the organization's brand |
POST /brand/import |
Import brand from website |
POST /templates/{key}/preview |
Preview a template |
POST /templates/{key}/publish |
Publish a template |
POST /brand/auto-import/dismiss |
Dismiss the automatic brand import |
POST /templates/{key}/duplicate |
Duplicate a template |
GET /templates/{key}/languages |
List the language variants of a template (Pidgely extension) |
GET /templates/{key}/languages/{locale} |
Retrieve a language variant (Pidgely extension) |
PUT /templates/{key}/languages/{locale} |
Create or replace a language variant (Pidgely extension) |
DELETE /templates/{key}/languages/{locale} |
Remove a language variant (Pidgely extension) |
POST /templates/{key}/languages/{locale}/translate |
Translate the base into a language with AI (Pidgely extension) |
Template builder & AI
| Endpoint | Description |
|---|---|
GET /template-builder |
Get template builder capabilities |
GET /template-builder/theme |
Get the organization's builder theme |
PATCH /template-builder/theme |
Update the organization's builder theme |
POST /template-builder/render |
Render a builder document |
POST /template-builder/convert |
Convert HTML to a builder document |
POST /template-builder/ai/rewrite |
Rewrite a block with AI |
POST /template-builder/ai/generate |
Generate an e-mail with AI |
POST /template-builder/ai/subjects |
Suggest subject lines with AI |
POST /template-builder/ai/translate |
Translate a template with AI |
Contacts
| Endpoint | Description |
|---|---|
POST /contacts |
Create a contact |
GET /contacts |
List contacts |
GET /contacts/{key} |
Retrieve a contact |
PATCH /contacts/{key} |
Update a contact (unsubscribed syncs the suppression list) |
DELETE /contacts/{key} |
Delete a contact |
POST /contacts/batch |
Upsert contacts in batch |
GET /contacts/{key}/segments |
List a contact's segments |
POST /contacts/{key}/segments/{segment_id} |
Add a contact to a segment |
DELETE /contacts/{key}/segments/{segment_id} |
Remove a contact from a segment |
Contact capture
| Endpoint | Description |
|---|---|
GET /contact-capture |
Retrieve the contact capture settings |
PATCH /contact-capture |
Update the contact capture settings |
POST /contact-capture/backfill |
Import the recipients of the last 90 days |
Events
| Endpoint | Description |
|---|---|
GET /events |
List events |
POST /events |
Record an event |
POST /events/batch |
Record events in a batch |
GET /events/names |
List event names |
Segments
| Endpoint | Description |
|---|---|
POST /segments |
Create a segment |
GET /segments |
List segments |
GET /segments/{id} |
Retrieve a segment |
PATCH /segments/{id} |
Rename a segment |
DELETE /segments/{id} |
Delete a segment |
GET /segments/{id}/contacts |
List a segment's contacts |
Broadcasts
| Endpoint | Description |
|---|---|
POST /broadcasts |
Create a broadcast |
GET /broadcasts |
List broadcasts |
GET /broadcasts/{id} |
Retrieve a broadcast |
PATCH /broadcasts/{id} |
Update a draft broadcast |
DELETE /broadcasts/{id} |
Delete a broadcast |
POST /broadcasts/{id}/send |
Send a broadcast |
POST /broadcasts/{id}/cancel |
Cancel a broadcast |
POST /broadcasts/{id}/duplicate |
Duplicate a broadcast |
Commerce (stores)
Automations
| Endpoint | Description |
|---|---|
POST /automations |
Create an automation from a preset |
GET /automations |
List automations |
GET /automations/{id} |
Retrieve an automation |
PATCH /automations/{id} |
Update an automation |
DELETE /automations/{id} |
Delete an automation |
GET /automations/presets |
List the automation presets |
GET /automations/summary |
Summarize a store's automations |
POST /automations/{id}/pause |
Pause an automation |
GET /automations/{id}/stats |
Retrieve automation stats |
POST /automations/{id}/activate |
Activate an automation |
GET /automations/{id}/enrollments |
List automation enrollments |
Suppressions
| Endpoint | Description |
|---|---|
POST /suppressions |
Add a suppression |
GET /suppressions |
List suppressions |
GET /suppressions/{id} |
Retrieve a suppression |
DELETE /suppressions/{id} |
Remove a suppression |
POST /suppressions/batch/add |
Add suppressions in batch |
POST /suppressions/batch/remove |
Remove suppressions in batch |
Audiences (legacy)
| Endpoint | Description |
|---|---|
POST /audiences |
Create an audience |
GET /audiences |
List audiences |
GET /audiences/{id} |
Retrieve an audience |
DELETE /audiences/{id} |
Delete an audience |
GET /audiences/{id}/contacts |
List an audience's contacts |
POST /audiences/{id}/contacts |
Create a contact in an audience |
GET /audiences/{id}/contacts/{key} |
Retrieve a contact · Audiences (legacy) |
PATCH /audiences/{id}/contacts/{key} |
Update a contact |
DELETE /audiences/{id}/contacts/{key} |
Delete a contact · Audiences (legacy) |
Native API (v1)
| Endpoint | Description |
|---|---|
POST /v1/api-keys |
Create an API key (native v1 API) |
GET /v1/api-keys |
List API keys (native v1 API) |
DELETE /v1/api-keys/{id} |
Revoke an API key |
POST /v1/domains |
Create a domain (native v1 API) |
GET /v1/domains |
List domains (native v1 API) |
GET /v1/domains/{id} |
Retrieve a domain (native v1 API) |
DELETE /v1/domains/{id} |
Delete a domain (native v1 API) |
POST /v1/domains/{id}/verify |
Verify DNS now |
POST /v1/emails |
Send an email (native v1 API) |
POST /v1/emails/batch |
Send up to 100 emails atomically |
GET /v1/emails |
List emails (native v1 API) |
GET /v1/emails/{id} |
Retrieve an email with deliveries |
POST /v1/emails/{id}/cancel |
Cancel a scheduled email (native v1 API) |
GET /v1/platform/metrics |
Platform numbers panel (platform team only) |
GET /v1/platform/watch/emails |
Emails of one tenant for the watcher (bearer token) |
GET /v1/platform/watch/metrics |
Platform metrics for the watcher (bearer token) |
GET /v1/platform/deliverability |
Platform deliverability report (platform team only) |
GET /v1/platform/watch/deliverability |
Platform deliverability report for the watcher (bearer token) |
POST /v1/suppressions |
Add a suppression (native v1 API) |
GET /v1/suppressions |
List suppressions (native v1 API) |
DELETE /v1/suppressions/{address} |
Remove a suppression (native v1 API) |
GET /v1/usage |
Retrieve usage |
POST /v1/webhooks |
Create a webhook (native event names) |
GET /v1/webhooks |
List webhooks (native v1 API) |
DELETE /v1/webhooks/{id} |
Delete a webhook (native v1 API) |