---
title: API overview
description: API overview - MailPirate Docs
---

# API overview

The Marketing API lets your website or backend:

- Subscribe people with proper consent handling
- Record behavioral and commerce events
- Read and upsert profiles
- List campaigns and segments
- Power public embed forms
- Receive outbound webhooks when consent or deliverability events happen

## Base URL

Production: `https://app.mailpirate.com/api/v1/marketing`

All authenticated routes expect JSON (`Content-Type: application/json`) and a Marketing API token from **Settings → API & webhooks**.

## Endpoint map

| Method | Path | Auth | Purpose |
|--------|------|------|---------|
| `POST` | `/subscribe` | Token | Consent-aware signup + default list |
| `POST` | `/events` | Token | Track events (optional profile upsert) |
| `GET` | `/profiles` | Token | Search/list profiles |
| `POST` | `/profiles` | Token | Create/update profile by email (no DOI by itself) |
| `GET` | `/profiles/{public_id}` | Token | Profile detail + predictive when present |
| `GET` | `/campaigns` | Token | Campaign list + counters |
| `GET` | `/segments` | Token | Segment list + cached counts |
| `POST` | `/forms/{form_public_id}/subscribe` | Public | Website form signup |

Outbound: configure webhooks under Settings → API & webhooks. See [Outbound webhooks](/docs/api/webhooks).

## Choose the right signup path

| Goal | Use |
|------|-----|
| Person opted in to marketing | `POST /subscribe` or an [embed form](/docs/api/embed-forms) |
| Sync CRM fields without starting confirmation email | `POST /profiles` |
| Track “Viewed Product” / custom events | `POST /events` |

## Conventions

- Always send `store_slug` for the store you mean
- Identify people, campaigns, segments, and forms with public IDs
- Retry safely: use `idempotency_key` on events
- Treat `401` / `403` / `422` / `429` as described in [Errors & limits](/docs/api/errors)

## Next

1. [Authentication](/docs/api/authentication)
2. [Subscribe](/docs/api/subscribe)
3. [Events](/docs/api/events)
4. [Outbound webhooks](/docs/api/webhooks)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://mailpirate.com/#organization","name":"MailPirate","legalName":"Jure Rožman s.p.","url":"https://mailpirate.com/","logo":{"@type":"ImageObject","@id":"https://mailpirate.com/#logo","url":"https://mailpirate.com/img/logo/mailpirate-logo.svg","contentUrl":"https://mailpirate.com/img/logo/mailpirate-logo.svg"},"image":{"@id":"https://mailpirate.com/#logo"},"description":"MailPirate is email marketing built for ecommerce stores: campaigns, automated journeys, living audiences, store sync, and deliverability control without managing mail servers yourself.","slogan":"Email that sells more for your store.","foundingDate":"2019-01-29","founder":{"@id":"https://mailpirate.com/#person-jure-rozman"},"address":{"@type":"PostalAddress","streetAddress":"Šinkov Turn 24A","addressLocality":"Vodice","postalCode":"1217","addressCountry":"SI"},"email":"info@mailpirate.com","telephone":"+38640504630","vatID":"SI72369213","identifier":[{"@type":"PropertyValue","propertyID":"AJPES registration number","value":"6881475000"}],"contactPoint":{"@type":"ContactPoint","contactType":"customer support","email":"info@mailpirate.com","telephone":"+38640504630","availableLanguage":["English"]},"knowsAbout":[{"@type":"Thing","name":"Email marketing"},{"@type":"Thing","name":"Ecommerce automation"},{"@type":"Thing","name":"Email deliverability"}],"areaServed":["SI","EU","GB","US"],"sameAs":["https://www.linkedin.com/company/mailpirate"]},{"@type":"Person","@id":"https://mailpirate.com/#person-jure-rozman","name":"Jure Rožman","jobTitle":"Founder","worksFor":{"@id":"https://mailpirate.com/#organization"},"description":"Founder of MailPirate. Builds ecommerce email tooling focused on fair billing, automation, and deliverability.","url":"https://mailpirate.com/about-us","sameAs":["https://www.linkedin.com/in/jurerozman/"]},{"@type":"WebSite","@id":"https://mailpirate.com/#website","url":"https://mailpirate.com/","name":"MailPirate","inLanguage":"en","publisher":{"@id":"https://mailpirate.com/#organization"},"about":{"@id":"https://mailpirate.com/#software"}},{"@type":"SoftwareApplication","@id":"https://mailpirate.com/#software","name":"MailPirate","applicationCategory":"BusinessApplication","applicationSubCategory":"Email marketing","operatingSystem":"Web","url":"https://mailpirate.com/","description":"Ecommerce email platform for Shopify and WooCommerce stores: campaigns, flows, segments, intelligence, and dedicated sending with deliverability controls.","publisher":{"@id":"https://mailpirate.com/#organization"},"featureList":["Campaigns and reporting","Automated flows (welcome, cart recovery, win-back)","Segments and lists","Store connectors (Shopify, WooCommerce)","Intelligence (RFM, affinity, send-time, replenishment)","Deliverability scorecard and dedicated sending","Marketing API and embed forms"]}]}
```
