canonical: https://jentic.com/apis/4dem.it/4dem

# 4dem It 4Dem Api

Jentic publishes the only available OpenAPI specification for 4Dem, keeping it validated and agent-ready. 4Dem is an Italian email marketing and marketing automation platform with 208 endpoints covering recipients, address books, campaigns, content, senders, reports, workflows, suppressions, custom fields, consents, SMS, e-commerce stores, and webhooks. Authentication uses HTTP bearer tokens obtained from the /authenticate endpoint and refreshed via /refresh_token. The API is suitable for managing the full lifecycle of an email programme from list management through send to performance reporting.

## For AI agents

Manage 4Dem email and SMS marketing - recipients, address books, campaigns, automation workflows, senders, content, reports, and ecommerce stores - using bearer token auth.

## Scope

Does not handle CRM pipelines, paid advertising, or website analytics - use for email and SMS marketing, recipient management, automation workflows, and campaign reporting only.

## Capabilities

- Manage recipients across address books - create, update, delete, search, and export contacts
- Build and send email campaigns with templates, content blocks, and scheduled delivery
- Run automation workflows that trigger on events, time delays, or recipient attributes
- Pull deliverability reports including opens, clicks, bounces, and per-domain trends
- Configure verified senders, custom fields, suppressions, and consent records
- Send transactional and marketing SMS alongside email through the SMS endpoints
- Sync e-commerce store data including products, attributes, and orders for behavioural targeting

## Use cases

### Email Campaign Send and Reporting

Schedule a marketing email to a segment and pull deliverability metrics afterwards. Create the campaign via the campaigns endpoints, attach content, schedule the send, then call the reports endpoints (e.g. /reports/campaigns/{campaignId}) for opens, clicks, bounces, and per-domain breakdowns. This replaces dashboard clicks with a programmable workflow.

Example prompt: Schedule campaign 'June Newsletter' to address book 12 for tomorrow at 09:00 CET, then 24 hours after send fetch /reports/campaigns/{campaignId} and persist opens, clicks, and bounces.

### Behavioural Marketing Automation

Build a workflow that triggers on a recipient attribute change, an ecommerce event, or a time delay using the workflows resource. Combine with consents and suppressions to ensure only opted-in contacts receive automated messages, and with stores resources to react to product or order events.

Example prompt: Create a workflow 'Cart Abandon' that triggers when a recipient leaves /carts/{cartId} non-empty for 60 minutes, sending the cart-abandon email content.

### List Hygiene And Suppressions

Maintain list quality by syncing hard bounces, complaints, and unsubscribes into 4Dem suppressions, and by exporting suppressions for use in adjacent tools. The suppressions, forgottens, and consents endpoints together enforce GDPR-style deletion and audit trails for Italian senders.

Example prompt: Pull all hard-bounced recipients from the last 7 days, add them to the global suppressions list, and remove them from address book 12.

### Agent-Driven Email Operations

Let an AI agent run the routine email programme - schedule sends, refresh bearer tokens, pull reports, and add recipients - through Jentic. The agent searches by intent, loads the schema, and executes; bearer tokens, including refresh tokens, are managed transparently by Jentic.

Example prompt: Through Jentic, search 'send a 4dem campaign', load the campaign-create schema, prepare and schedule the campaign, and after send fetch the report into a database.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /authenticate | Obtain a bearer token |
| POST | /refresh_token | Refresh a bearer token |
| GET | /reports/campaigns/{campaignId} | Get a campaign's performance report |
| GET | /addressbook/ | List address books |
| GET | /addressbook/{addressbookId} | Get a specific address book |
| GET | /apikeys | List API keys |

## Key resources

- **Recipients** — Create, update, search, export, and delete contacts
- **Address Books** — Manage segmented contact lists
- **Campaigns** — Build, schedule, and send email campaigns
- **Reports** — Per-campaign opens, clicks, bounces, and trend reports
- **Workflows** — Trigger-based marketing automation
- **Senders** — Manage verified senders for delivery
- **Suppressions** — Maintain unsubscribe and bounce suppression lists
- **Consents** — Track GDPR-style consent records
- **SMS** — Send transactional and marketing SMS
- **Stores** — Sync ecommerce products and attributes for behavioural targeting
- **Authenticate** — Bearer token issuance and refresh

## Why Jentic

- **Setup:** Wiring the 4Dem API by hand means managing its bearer access token, calling authenticate and refresh_token to keep it current, and shaping campaign and recipient payloads yourself. Through Jentic you install once, import the 4Dem API from the API Directory, store the credentials once, and your agent calls it.
- **Permission scoping:** 4Dem puts the campaign and address-book id in the URL path (/reports/campaigns/{campaignId}, /addressbook/{addressbookId}), so a rule can pin your agent to one campaign or address book. You choose the operations it may call, so reading API keys is not included unless you add it.
- **Credential handling:** Your 4Dem access and refresh tokens are stored once, encrypted, by your own Jentic One instance and injected at execution time. They never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'read a campaign report' or 'list address books', and Jentic returns the matching 4Dem operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Mailchimp API** — Mailchimp is a global email marketing platform with similar list, campaign, and automation primitives.
- **Brevo API** — Brevo (formerly Sendinblue) covers email, SMS, and marketing automation with a similar feature surface.
- **Klaviyo API** — Klaviyo is built around ecommerce data with deep Shopify and BigCommerce integrations.
- **Mailjet API** — Mailjet handles transactional email delivery alongside 4Dem's marketing campaigns.

## FAQ

### Why is there no official OpenAPI spec for 4Dem?

4Dem publishes a developer reference at api.4dem.it/open-api but no canonical OpenAPI specification with the full endpoint surface modelled. Jentic generates and maintains this spec so that AI agents and developers can call 4Dem via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the 4Dem API use?

It uses HTTP bearer tokens. Obtain a token via POST /authenticate with API credentials, then send Authorization: Bearer {token} on subsequent requests. Refresh tokens via POST /refresh_token. Through Jentic, both the access and refresh tokens are stored encrypted in the vault and rotated automatically.

### How do I send a campaign with 4Dem?

Build the campaign content via the contents endpoints, create the campaign on the campaigns resource, attach the address book, and schedule the send. After delivery, GET /reports/campaigns/{campaignId} returns opens, clicks, and bounces, and per-domain trends are available under /reports/campaigns/{campaignId}/domains/{activity}.

### Can I send SMS through 4Dem?

Yes. The SMS endpoints support transactional and marketing SMS alongside email. Combine SMS with email workflows to run multi-channel sequences from a single provider.

### How do I add a recipient to an address book through Jentic?

Run pip install jentic, then search 'add a 4dem recipient', load the recipients-create operation, supply the address book ID and recipient fields, and execute. Run it through Jentic One, the self-hosted execution layer to receive an agent API key for execution.

### Does 4Dem support marketing automation workflows?

Yes. The workflows endpoints let you build trigger-based automations such as welcome sequences, cart abandon, and re-engagement campaigns. Workflows can read recipient attributes, ecommerce store data, and consent state to decide who enters the flow.

### Can I limit what my agent is allowed to do with the 4Dem API?

Yes. Jentic One runs on your own infrastructure, and your own rules decide which 4Dem operations and credentials the agent may use. Because 4Dem puts the campaign and address-book id in the URL path, such as /reports/campaigns/{campaignId} and /addressbook/{addressbookId}, you can pin the agent to a single campaign or address book. You also choose which operations it may call, so sensitive endpoints like listing API keys at /apikeys stay off limits unless you explicitly grant them.
