Connect a Make scenario to an agent email inbox

Checked · Markdown

Short answer

There's no Agentline NZ app in Make, so use the HTTP app's Make a request module to call the REST API at https://agentline.nz/api/v1, with your API key in an API key keychain as Authorization: Bearer. A scenario can then send email from an @agentline.nz address, read the inbox and wait for one-time codes sent by email.

Before you start

  • An Agentline NZ API key from Dashboard → API keys. It starts with al_live_. No credit card needed to sign up. Start free with an email inbox, or try Starter or Pro free for 7 days.
  • Your @agentline.nz email inbox works straight away. Texting and phone numbers are coming soon.
  • Until you're on a paid plan, your agent can only email your own verified email address. Anything else returns recipient_not_allowed.

Send an email from a scenario

  1. Add the module. In your scenario, add the HTTP app's Make a request module.
  2. Create a keychain for your key. Set Authentication type to API key and create a keychain under Credentials. Set Key to Bearer followed by a space and your Agentline NZ API key, API key placement to In the header, and API key parameter name to Authorization. Other HTTP modules in the scenario can reuse the same keychain.
  3. Set the request. Set URL to https://agentline.nz/api/v1/emails, Method to POST, Body content type to application/JSON and Body input method to JSON string, then enter the body below. to is one address or an array of up to 5, subject is up to 300 characters, and text is the message. To answer an email in the same thread, add reply_to_id with the id of the email you're replying to. If you build the body by mapping text from earlier modules, choose Data structure as the body input method instead, so Make escapes quotes and line breaks for you.
    {"to": "someone@example.com", "subject": "Your booking", "text": "See you at 3pm Thursday."}
  4. Parse the response and run it once. Set Parse response to Yes and run the module once, so later modules can map email.id and email.status (sent). A 4xx response carries an error object with a code and message. Set Return error if HTTP request fails to Yes under Advanced settings if you want the scenario to stop on one. A module that replies to incoming email should leave it at No, as shown further down.

Read the inbox

Use Make a request with Method GET and URL https://agentline.nz/api/v1/emails. Under Query parameters you can add:

  • direction: in for received emails only, or out for sent ones
  • unread_only: true to skip emails already marked read
  • since_seconds: only emails from the last N seconds
  • limit: 1 to 100 (20 by default)

Emails come back as {"emails": [...]}, newest first. Each email has a 280-character snippet; for the full text, GET https://agentline.nz/api/v1/emails/{id}.

Wait for a one-time code

POST to https://agentline.nz/api/v1/wait-for-code:

{"channel": "email", "timeout_seconds": 55, "from_contains": "Google"}

from_contains (optional) matches the sender or the message text. The request stays open until a code arrives or timeout_seconds passes (55 at most), so set Timeout under Advanced settings to 60. The response is {"found": true, "code": "123456", "channel": "email", "messageId": "…", "from": "…", "receivedAt": "…", "preview": "…"}, or {"found": false} if nothing arrived in time. Each code is returned once. Add a filter after the module that only continues when found is true.

Run a scenario when an email arrives

Agentline NZ doesn't send webhooks to your own URLs, so a Custom webhook trigger won't receive anything. Poll instead. A polling scenario suits forwarding or logging new email, such as posting each one to Slack or adding it to a sheet:

  1. Schedule the scenario to run at regular intervals. On Make's Free pricing plan, scheduled scenarios run at most every 15 minutes.
  2. Start it with Make a request: Method GET, URL https://agentline.nz/api/v1/emails, query parameters direction = in, unread_only = true and limit = 25, Parse response set to Yes, and Return error if HTTP request fails set to Yes under Advanced settings.
  3. Add an Iterator on emails so each email runs through the rest of the scenario.
  4. Add the modules that forward or log the email.
  5. At the end, mark the email read with a POST to https://agentline.nz/api/v1/mark-read and the body {"ids": ["<the email id>"]}, mapping the id from the Iterator, with Return error if HTTP request fails set to Yes. It returns {"read": true, "updated": [...], "notFound": [...]}.

If a step fails, the run stops before mark-read and the email stays unread for the next run to retry. Mark each email read straight after its work is done, so a retry doesn't repeat finished work. Emails come newest first, and anything past the limit stays unread for the run after. By default Make turns a scenario's schedule off after 3 runs in a row end in an error, so check the scenario history if one email keeps failing. Read state is shared across your account: opening an email in the dashboard, or another agent calling mark_read, also marks it read.

Reply to each incoming email

Some replies fail every time, and a scenario that stops on them never gets past that email. If the replies need judgement, an agent connected over MCP, such as Claude or a LlamaIndex agent, is simpler. For short fixed replies, such as an acknowledgement, start from the polling scenario above and change it like this:

  1. Use limit = 10, so one run never sends more than the 10 emails a minute your account can send.
  2. Add a Router after the Iterator with two routes. The first route goes straight to a mark-read module, with no reply. Give it a filter where from Contains (case insensitive) noreply or no-reply, so the scenario never answers automated senders.
  3. Until you're on a paid plan, your agent can only email your own verified email address. Until then, add an OR condition to the first route's filter: from Not equal to (case insensitive) your verified email address. Everything else is marked read without a reply. Remove the condition once you're on a paid plan.
  4. Put the reply module on the second route, and set that route as the fallback route. Leave Return error if HTTP request fails at No on the reply module, so every response comes out of the module with its status code. Make's help says a 401 or 403 response can come back as an AccountValidationError. An error handler can't catch that error, and Make turns the scenario's schedule off after it. With the setting on, one reply that's never allowed could switch the whole scenario off.
  5. Between the reply module and its mark-read module, add a filter that passes only when the reply's Status code is Greater than or equal to 200 and Less than 300, or Equal to 400, 403 or 422. In Make that's four condition groups joined by OR, and the first group has both numeric conditions. Sent replies are marked read. So are replies that will never succeed: 400 invalid_recipient, 403 recipient_not_allowed, and 422 content_phishing and the other content_ codes. Every other response leaves the email unread for a later run to retry: 401 unauthorized, 402 quota_exceeded or subscription_required, 409 no_inbox, 429 rate_limited or owner_unverified, and any 5xx.

Check the status codes of the first few runs. If every reply returns 400 or 422, the reply module is set up wrong, not the senders: 400 invalid_request or invalid_json means a missing or misnamed field or a body that isn't valid JSON, and a 422 content_ code on a fixed reply means the reply text itself fails the content checks. The filter marks those emails read without a reply, so turn the scenario off and fix the module's body before you run it again.

A 402 is about your plan, not the scenario: quota_exceeded means the email allowance is used up, and subscription_required means the account has no live plan or trial. See what's used on the dashboard and change plan on its Billing page, or compare plans on Pricing. Until the account can send again, turn the scenario off. Each scheduled run still fetches and retries the same emails, and every run uses Make credits. Keep Return error if HTTP request fails set to Yes on the fetch and mark-read modules. If mark-read fails after a reply was sent, the run stops and the next run replies again. Make reads a 429 on those modules as a RateLimitError and pauses a scheduled scenario for 20 minutes. Each run makes at most 31 requests: one fetch, up to 10 GETs of the full email, up to 10 replies and up to 10 mark-reads. That stays well under the 120 requests a minute each key allows. The send caps are shared by every key and agent on your account, so other sends in the same minute can push a reply into a 429, and that email is retried on the next run.

Good to know

  • Each API key can make 120 requests a minute.
  • Sending is capped per account, and every API key and agent on the account shares the caps: 10 emails a minute and 200 a day.
  • On a 429 rate_limited response, wait the number of seconds in the Retry-After header before retrying. The daily caps, including owner_unverified for the daily send cap before the owner opens the verification link, reset at midnight UTC, so their Retry-After can be many hours. Keep sends within your plan's or trial's email allowance, which resets monthly.
  • Transactional and assistant messages only: replies, bookings, confirmations, reminders people asked for, and codes. Marketing, promotions, cold messages and bulk messages aren't allowed.
  • Make only calls https URLs, so this works against https://agentline.nz but not a local test server.
  • Create a key just for Make and revoke it in the dashboard if you stop using the scenario. Updating the keychain updates every module that uses it.
  • The docs list every REST endpoint.
  • Texting and phone numbers are coming soon. To hear when they're ready, join the waitlist.

FAQ

Is there an Agentline NZ app in Make?

No. Use the HTTP app's Make a request module with an API key keychain to call the REST API, as shown on this page.

Can a scenario start when an email arrives?

Agentline NZ doesn't send webhooks, so schedule the scenario and poll the email list with direction=in, unread_only=true and limit=25, then mark each email read with POST /mark-read straight after its work is done. This suits forwarding or logging email. A scenario that replies to each email needs limit=10, a filter that skips automated senders, and a status code filter on the reply, as described on this page. For replies that need judgement, use an agent connected over MCP.

What does Agentline NZ cost?

Starter is NZ$29/month and Pro is NZ$79/month, billed in NZ dollars. No credit card needed to sign up. Start free with an email inbox, or try Starter or Pro free for 7 days. You can cancel anytime, and your plan stops at the end of the billing period you've paid for. Refunds follow section 5 of our Terms: fees already paid aren't refunded, except where the Terms or the law say so. Agentline NZ is not GST-registered, so no GST is charged.

When does the inbox work, and can my assistant send texts yet?

Your @agentline.nz email inbox works straight away. Texting and phone numbers are coming soon. To hear when texting is ready, join the waitlist.

Can my assistant send marketing or bulk email?

No. Transactional and assistant messages only: replies, bookings, confirmations, reminders people asked for, and codes. Marketing, promotions, cold messages and bulk messages aren't allowed. See What we don't allow.

Start free · No credit card needed to sign up. Start free with an email inbox, or try Starter or Pro free for 7 days.