Category: API, webhooks and AI tools

  • Sender MCP server

    TL;DR: The Sender MCP server connects your Sender account to an AI assistant such as Claude, ChatGPT or Cursor. The assistant can read your subscribers, segments, campaigns and workflows, and create drafts for you. It can’t send a campaign. Connect with the URL https://mcp.sender.net/mcp and log in through OAuth.

    Where to find it: In your AI assistant’s connector settings. There’s nothing to enable in Sender. In the Sender app, Connect to AI tools at the bottom of the left sidebar opens these guides.

    Connect to AI tools menu in the Sender sidebar with Connect to ChatGPT, Connect to Claude and Learn about MCP

    How it works

    MCP (Model Context Protocol) is an open standard that lets AI models use outside tools. Once connected, your assistant can call Sender tools on your behalf.

    • Login is OAuth. You log in to Sender in a browser window and approve access. There’s no API key to copy, and you can revoke access at any time.
    • Everything created is a draft. Campaigns are never sent through this connection. Workflows are created inactive.
    • Your role applies. If your Sender user role can’t do something in the app, the assistant can’t either.

    For ideas, see AI use cases for the MCP server.

    What you need

    • An MCP-compatible client. Claude, ChatGPT and Cursor support remote MCP servers. Availability depends on your plan with them.
    • A Sender role with the right permissions. See user roles and permissions.
    • A verified sending domain for anything that will send later. Campaign drafts and workflow emails need a from address on a verified domain.

    Connecting Sender to Claude

    1. Open connectors. In Claude, go to Customize → Connectors.
    2. Add a connector. Click +, then Add custom connector.
    3. Enter the details. Name it Sender, enter https://mcp.sender.net/mcp as the URL and click Add.
    4. Connect. Select the Sender connector, click Connect, log in to Sender and approve the permissions.
    5. Test it. Start a chat and ask “List my segments”.

    On Claude Team and Enterprise plans, an organization Owner must add the connector for the organization first. After that, the connector works in Claude on web, desktop and mobile.

    Connecting Sender to ChatGPT

    Custom MCP servers in ChatGPT need developer mode.

    1. Turn on developer mode. Open Settings → Plugins, click Developer mode and turn the toggle on.
    2. Add the server. Go back to Plugins, click Browse plugins, then the + sign.
    3. Enter the details. Name it Sender, enter https://mcp.sender.net/mcp as the connection server URL and set authentication to OAuth.
    4. Log in to Sender and approve the permissions.
    5. Select the Sender app in the composer before you ask about your account.

    Connecting Sender to Cursor

    1. Open MCP settings. Go to Cursor Settings → MCP → New MCP Server, or edit your MCP configuration file.
    2. Add this entry:
    {
      "mcpServers": {
        "sender": {
          "url": "https://mcp.sender.net/mcp"
        }
      }
    }
    1. Save and log in when Cursor prompts you.

    2. Start a chat and confirm the Sender tools appear.

    Use several Sender accounts

    Each connection belongs to one Sender account. For more, add one connector per account with a clear name, such as sender-brand-a and sender-brand-b, and log each one in separately. Enable only the connector you’re working in, so the assistant can’t read one account and write to another.

    What you can ask for

    • “Review my segments and tell me which are broken, duplicated or misnamed.”
    • “Which of my automations overlap? Show what a new subscriber gets in their first two weeks.”
    • “Compare my three upsell workflows: sends, opens, clicks and unsubscribes.”
    • “Check my onboarding emails for broken links, missing preheaders and wrong alt text.”
    • “Draft a short welcome sequence and build it as a draft workflow.”

    Audit and build segments

    The assistant reads every condition in a segment, not only its name. That’s how it finds filters that stopped working, such as a “30-day most engaged” segment built on a fixed date two years ago. It also finds duplicates and names that promise a filter the segment doesn’t apply.

    Describe a replacement in plain words, for example “signed up over 12 months ago, no opens or clicks in the last 365 days”. The assistant creates it and reads the conditions back to you.

    Review automations

    Ask what a subscriber actually receives and you get one merged timeline across every active workflow. Two workflows with the same trigger, plus stacked delays, can mean five emails in nine days. The assistant can show the timeline, pull each workflow’s report and point out steps that block activation or can’t be reached.

    Check email content

    The assistant reads campaign and workflow email bodies and catches details such as:

    • social icons or images with wrong or placeholder alt text
    • links that contradict the email
    • old {$firstname} tags, which reach subscribers as plain text. Sender uses Liquid: {{ firstname }}
    • missing preheaders

    Build a workflow

    Describe the sequence and the assistant creates the whole workflow as a draft: trigger, delays, conditions and splits. You get a plain-language outline of the branches and a list of what still blocks activation. It can then write the emails, run a validation and activate only when you ask.

    Available tools

    Your client finds the tool list automatically. The full reference is in the Sender MCP documentation.

    AreaReadWrite
    AccountAccount details, sending domains, SMS numbers, connected stores, event types and events
    Subscribers and groupsList and get subscribers and groupsCreate, update, subscribe and unsubscribe subscribers
    SegmentsList and get segments, with conditions read backCreate and update segments
    Email campaignsList and get campaigns and reportsCreate a draft campaign, replace a draft’s content
    WorkflowsList, get, validate, read reports and step contentCreate, rename, add, update and delete steps, edit email and SMS content, activate, deactivate
    ImagesList image foldersUpload images from a file or URL

    What it won’t do

    • It never sends a campaign. There’s no tool for it.
    • It doesn’t activate workflows quietly. Activation is one deliberate step and runs the same checks as the app. If anything blocks it, nothing goes live.
    • It doesn’t edit active workflows. Deactivate first. Subscriber progress is kept.
    • It doesn’t delete quietly. Dropping subscribers waiting on a step, or overwriting a drag & drop design, needs an explicit flag.
    • It limits workflow creation to 50 per account per day.

    Anything the assistant creates shows in Sender straight away as a draft. Review it, edit it and send or activate it yourself.

    If the connection doesn’t work

    • You can’t connect: check the URL is exactly https://mcp.sender.net/mcp. A proxy on your side can also block it.
    • Authentication fails: finish the OAuth steps in the browser window. On managed AI plans, an administrator may need to add the connector first.
    • Tools are missing: restart the client and check the connector is enabled for that conversation.
    • A tool returns a permission error: your Sender role doesn’t allow that action. Ask the account owner to connect, or to change your role.
    • A workflow won’t activate: ask the assistant to validate it. Most often an email step’s from address isn’t on a verified domain.
    • Personalization shows as plain text: the content uses {$firstname} in place of {{ firstname }}.

    Sender MCP server FAQs

    Can an AI assistant email my subscribers?

    No. Campaigns stay drafts. Workflows go live only when you ask for activation and the checks pass.

    Do I need a paid Sender plan?

    No. The Sender MCP server works on every plan, including Free. Features your plan doesn’t include aren’t available through it either.

    Can I disconnect it?

    Yes. Remove the connector in your assistant. Nothing created before that is affected.

    Does it work with other assistants?

    Any client that supports remote MCP servers with OAuth should work.

    What to read next

    Start with the Sender MCP prompts, then build automations, create segments and draft campaigns with your assistant. Every action is listed in the Sender MCP tools reference, and the rules that protect your account are in Sender MCP permissions and safety. For direct API access, see REST API authentication.

  • Common API errors

    TL;DR: Sender’s API returns a 4xx code when something is wrong with your request and a 5xx code when the problem is on Sender’s side. For API errors, the response body tells you why: read the message field, and for validation errors the errors object.

    Where to find it: The status code and body of any response from https://api.sender.net/v2/

    Error codes at a glance

    CodeMeaningFix
    400 Bad RequestThe request is well-formed but can’t be done, for example “You must activate workflow first”Read message and complete the missing step
    401 UnauthorizedThe token is missing, malformed or revokedSend Authorization: Bearer YOUR_TOKEN with a valid token
    404 Not FoundThe endpoint or resource ID doesn’t existCheck the path and the ID
    422 Bad request parametersA field is missing or invalidRead the errors object and fix each field
    429 Too Many RequestsYou passed the rate limitWait the seconds in Retry-After
    5xx Server errorA temporary problem at SenderWait 30–60 seconds and retry

    What an error looks like

    A validation error (422) returns a body like this:

    {
      "message": "The given data was invalid.",
      "errors": {
        "email": ["Required value, email"]
      }
    }
    

    Each key in errors is a field name. Its value lists what’s wrong with that field.

    Fix each error

    1. 401: check the token. Go to Account settings → API access tokens and confirm the token exists. The header needs one space after Bearer. See REST API authentication.
    2. 400 and 422: check the body. Make sure the body is valid JSON, required fields such as email are present, and each value has the right type.
    3. 404: check the URL. Paths are plural, for example /v2/subscribers, not /v2/subscriber. Confirm the ID or email in the path exists in your account.
    4. 429: slow down. See API rate limits.
    5. 5xx: retry later. If it continues, email [email protected] with the method, endpoint, time and response.

    After a fix, resend the request. Success is a 200 or 201 with "success": true.

    Debugging tips

    • Log everything: status code, headers and the full body.
    • Send all three headers: Authorization, Content-Type: application/json and Accept: application/json.
    • Reproduce with cURL. It shows whether the problem is the request or your code.
    • Use HTTPS only. Plain HTTP requests fail.

    Other things that look like errors

    • A 200, but nothing changed in Sender. Refresh the page, and check you used the token for the right account.
    • An empty data array. The page is past the last page. Check meta.last_page.
    • A timeout or no response. Your network blocks outbound HTTPS on port 443, or the URL uses http://.
    • A response that isn’t JSON. The Accept: application/json header is missing.

    API error FAQs

    Why do I get 401 with a token that worked before?

    It was deleted or expired. Create a new one and update your code.

    Can I retry a failed request automatically?

    Retry 429 and 5xx with a delay. Don’t retry 400, 401, 404 or 422 without changing the request.

    Where’s the full API reference?

    At api.sender.net.

    What to read next

    Check your setup step by step in testing API calls.

  • Sender API authentication with access tokens

    TL;DR: Sender API authentication uses an API access token as a Bearer token. Create one in Account settings → API access tokens, then send it in an Authorization: Bearer header with every request to https://api.sender.net/v2/. The same token handles plugin activation for Sender plugins, like the WordPress plugin. Full API documentation lives at api.sender.net.

    Where to find it: Account settings → API access tokens

    What you need

    • A Sender account
    • An API access token
    • A way to send HTTP requests, like cURL, Postman or your own code

    You need a token for two things: calling the Sender REST API and activating Sender plugins for platforms like WordPress.

    Create an API access token

    Step 1: Open API access tokens

    Go to Account settings → API access tokens, or open app.sender.net/settings/tokens directly.

    API access tokens page in Account settings

    Step 2: Create the token

    1. Click Create API token.
    2. Pick how long the token stays valid: Forever, 30 days, 7 days or 1 day. For plugins and long-running integrations, pick Forever.
    3. Click Create.

    Step 3: Copy and store it

    Copy the token right away and keep it somewhere safe, like a password manager or an environment variable. You may not see it again once you leave the page.

    Authenticate your requests

    All API v2 requests use the base URL https://api.sender.net/v2/ over HTTPS. Plain HTTP calls fail.

    Send these three headers with every request:

    Authorization: Bearer YOUR_API_TOKEN
    Content-Type: application/json
    Accept: application/json
    

    Here’s a request with cURL:

    curl -X GET "https://api.sender.net/v2/subscribers" \
      -H "Authorization: Bearer YOUR_API_TOKEN" \
      -H "Content-Type: application/json" \
      -H "Accept: application/json"
    

    And the same idea in JavaScript:

    const url = "https://api.sender.net/v2/campaigns";
    fetch(url, {
      method: "GET",
      headers: {
        "Authorization": "Bearer YOUR_API_TOKEN",
        "Content-Type": "application/json",
        "Accept": "application/json"
      }
    }).then(response => response.json());
    

    Test the connection

    Send a GET request to https://api.sender.net/v2/subscribers. If it works, you get a 200 status and a JSON body with a data array of subscribers, plus links and meta for pagination. A 401 Unauthorized response means the token is missing, wrong or expired.

    Use the API documentation

    The full reference is at api.sender.net. Endpoints are listed on the left, and each one shows example requests in several programming languages. Endpoints marked requires authentication need your token in the Authorization header.

    Sender API documentation with endpoints listed on the left
    Example API requests in different programming languages

    A few endpoints to start with:

    • GET /v2/subscribers returns your subscribers. Use page, limit, order and direction to page and sort.
    • GET /v2/subscribers/{email, phone or ID} returns one subscriber, including their custom fields.
    • GET /v2/campaigns returns your campaigns. Filter with status: SCHEDULED, SENDING, SENT or DRAFT.

    Error codes

    CodeWhat it meansWhat to do
    400The request is malformedRead the message field in the response
    401Token missing, wrong or expiredCheck the header or create a new token
    404The resource doesn’t existCheck the endpoint path and IDs
    422A parameter failed validationCheck the errors object for the field
    429Too many requestsWait for the seconds in Retry-After, then retry

    Tips for API access tokens

    • Keep tokens out of code. Store them in environment variables or a secrets manager, never in client-side code or public repositories.
    • Use short lifetimes for one-off jobs. For a one-time migration, pick 1 day or 7 days instead of Forever.
    • Use one token per app. You can create several tokens, so you can replace one without breaking the others.
    • Back off on rate limits. On a 429, wait for Retry-After and increase the delay if it happens again.

    If something doesn’t work

    • 401 right after creating the token. The token wasn’t copied in full or has extra spaces. Copy it again, or create a new one.
    • Connection errors. You’re calling http:// instead of https://. Use https://api.sender.net/v2/.
    • 422 on POST or PATCH requests. A required field is missing or invalid. The errors object names the field.
    • 429 during bulk jobs. You’re sending too many requests. Slow down and check the X-RateLimit-Remaining header.
    • The token stopped working. It had a 1, 7 or 30 day lifetime and expired. Create a new token and update your app or plugin.

    API authentication FAQs

    Where do I find my API access token?

    In Account settings → API access tokens. Click Create API token to make a new one.

    Do plugins use the same API access token?

    Yes. You use the same API access token to activate Sender plugins, like the WordPress plugin.

    Can I have more than one token?

    Yes. Each token works on its own. Use separate tokens for different apps so you can replace one without affecting the rest.

    How do I page through many subscribers?

    Use the page and limit parameters. The meta object shows current_page, last_page and total.

    What to do next

    See which apps already connect without code in Sender integrations. Get real-time event data with webhooks, or connect apps without code using the Sender Zapier integration. To connect an AI assistant instead of writing code, see the Sender MCP server.

  • API rate limits

    TL;DR: Sender’s API limits how many requests your account can make per minute. Every response tells you the limit and how many requests are left. API rate limits are shared across all your tokens. When you go over, you get a 429 response with a Retry-After header telling you how long to wait.

    Where to find it: The response headers of any request to https://api.sender.net/v2/

    The rate limit headers

    Every response includes these headers:

    HeaderMeaning
    X-RateLimit-LimitRequests allowed per minute for your account
    X-RateLimit-RemainingRequests left in the current window
    X-RateLimit-ResetWhen the window resets
    Retry-AfterSeconds to wait. Sent only with a 429

    Example:

    X-RateLimit-Limit: 60
    X-RateLimit-Remaining: 45
    X-RateLimit-Reset: 2026-03-18T13:02:00Z
    

    Your own limit is whatever X-RateLimit-Limit returns.

    What a rate limit response looks like

    HTTP/1.1 429 Too Many Requests
    Retry-After: 30
    X-RateLimit-Limit: 60
    X-RateLimit-Remaining: 0
    

    Stop sending requests and wait the number of seconds in Retry-After.

    Handle rate limits in your code

    1. Read the headers on every response, not only on errors.
    2. Slow down early. When X-RateLimit-Remaining drops below a small number, such as 5, pause until the window resets.
    3. Honor Retry-After on a 429. If the header is missing, use exponential backoff: wait 1 second, then 2, then 4, up to a ceiling such as 60 seconds.
    4. Cap retries. After about 5 attempts, log the failure and alert someone.
    import time
    import requests
    
    def get_with_backoff(url, headers, max_retries=5):
        delay = 1
        for attempt in range(max_retries):
            response = requests.get(url, headers=headers)
            if response.status_code != 429:
                return response
            wait = int(response.headers.get("Retry-After", delay))
            time.sleep(wait)
            delay = min(delay * 2, 60)
        return response
    

    Use fewer requests

    • Fetch more per call. List endpoints such as GET /v2/subscribers accept ?limit and ?page.
    • Avoid polling. Don’t request the same list every few seconds.
    • Coordinate your services. The limit is per account, so every token and background job shares it.

    If you hit limits unexpectedly

    • You get a 429 with low traffic: another service or token on the same account is using the allowance.
    • Remaining showed more than 0, then a 429 came: parallel requests used the rest. Always handle 429, whatever the last header said.
    • Retries create duplicates: a retried POST can create a record twice. Check whether it exists before retrying.
    • The headers are missing: the request wasn’t authenticated or didn’t use HTTPS. See REST API authentication.

    API rate limit FAQs

    Is the limit per token or per account?

    Per account. All tokens share one window.

    Does a 429 count against me?

    It doesn’t harm your account. Keep retrying without waiting, though, and you’ll keep getting 429.

    Can I raise my limit?

    Contact support and describe your use case.

    What to read next

    See the other status codes in common API errors, and try requests safely with testing API calls.

  • Testing API calls

    TL;DR: To test API calls, start with a read-only GET, then create one test subscriber with trigger_automation set to false. Sender has no sandbox, so every call changes your live account. Delete test data when you’re done.

    Where to find it: Any HTTP client, such as cURL or Postman, pointed at https://api.sender.net/v2/

    Before you start

    You need an API access token from Account settings → API access tokens. See REST API authentication. Every request needs these headers:

    Authorization: Bearer YOUR_API_TOKEN
    Content-Type: application/json
    Accept: application/json
    

    Run five test requests

    1. Check your token. A read-only request changes nothing:

    bash curl -X GET "https://api.sender.net/v2/subscribers" \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -H "Accept: application/json"

    A 200 with data, links and meta means the token works. A 401 means it doesn’t.

    1. Test query parameters. Request https://api.sender.net/v2/groups?page=1&limit=5 with the same headers. The meta object should show current_page, per_page, total and last_page.

    2. Create a test subscriber. Only email is required:

    bash curl -X POST "https://api.sender.net/v2/subscribers" \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{"email": "[email protected]", "firstname": "Test", "trigger_automation": false}'

    Success returns "success": true and the subscriber in data.

    1. Cause an error on purpose. Send the same request with "email": "not-a-valid-email". You should get a 422 with an errors object. Confirm your code reads it.

    2. Verify the result. Request https://api.sender.net/v2/subscribers/[email protected], or open Subscribers in Sender and search for the address.

    Endpoints used here

    RequestWhat it does
    GET /v2/subscribersLists subscribers. Accepts page, limit, order and direction
    GET /v2/subscribers/{email}Returns one subscriber. Also accepts a phone number or ID
    POST /v2/subscribersCreates a subscriber. Optional fields: firstname, lastname, groups, fields, phone, trigger_automation
    GET /v2/groupsLists groups

    Test safely on a live account

    • Turn automations off. "trigger_automation": false stops workflows from starting for test subscribers.
    • Use your own addresses, or ones you control.
    • Use a test group so test data is simple to find and delete.
    • Watch X-RateLimit-Remaining while you run scripts. See API rate limits.
    • Clean up. Delete test subscribers afterwards.

    If a test fails

    • Every request returns 401: the header must be exactly Bearer, one space, then the token.
    • Creating a subscriber returns 422: email is missing or invalid, or the body isn’t valid JSON.
    • The data array is empty: the account has none of that resource, or page is too high.
    • The connection is refused: use https://, and check your network allows port 443.

    More codes are covered in common API errors.

    Testing API calls FAQs

    Is there a sandbox?

    No. All calls act on your live account.

    Which tools can I use?

    cURL, Postman, or code in any language. The API docs at api.sender.net have examples in JavaScript, PHP, Python and Bash.

    What does a successful response look like?

    A 200 or 201 status with the resource in the data field.

    What to build next

    Send events from your app with custom events.