Docs

Connect your agent

Use Agentline from ChatGPT or Claude with MCP, or from your own code with the REST API.

Quickstart

  1. Create an account and choose a plan. Your inbox appears straight away; your 028 number is assigned within one business day.
  2. Connect ChatGPT or Claude using the MCP URL below, or create an API key under Dashboard → API keys.
  3. Ask your agent: "What's my Agentline number?" and then "Sign up for … and wait for the code."

MCP server URL (Streamable HTTP):

https://agentline.nz/mcp

Claude connector

  1. In Claude (web or desktop) open Settings → Connectors and choose Add custom connector.
  2. Name it Agentline and paste https://agentline.nz/mcp as the URL. Leave the OAuth client fields empty.
  3. Click Connect. Sign in to Agentline with your email link and approve access.
  4. In a chat, enable the Agentline tools from the tools menu. On Team and Enterprise plans an owner adds the connector for the organisation first.

Claude Code: claude mcp add --transport http agentline https://agentline.nz/mcp, then run /mcp to sign in.

ChatGPT app

  1. In ChatGPT open Settings → Apps. Search for Agentline, or (with developer mode enabled) choose Create app and enter https://agentline.nz/mcp with OAuth authentication.
  2. Sign in to Agentline and approve access. You can untick "send" to give ChatGPT read-only access.
  3. Mention Agentline in a chat, or pick it from the tools menu.

ChatGPT asks you to confirm before Agentline sends anything, because the send tools are marked as write actions. SMS, email and codes appear as compact cards in the conversation.

MCP tools

ToolWhat it doesScope
get_my_numberYour number(s), inbox(es), plan and usageread
send_smsText a NZ mobile from your numbersend
list_messagesRecent SMS, newest firstread
read_messageOne SMS by idread
send_emailEmail from your @agentline.nz addresssend
list_emailsRecent emailsread
read_emailFull email text by idread
wait_for_codeWait up to 55s for an OTP by SMS or emailread
list_callsCalls and voicemail transcriptsread
get_profileWhich Agentline account is connectedread

Your own agents can use the same MCP endpoint with an API key: send Authorization: Bearer al_live_….

REST API

Base URL https://agentline.nz/api/v1. Authenticate with Authorization: Bearer al_live_…. Requests and responses are JSON. An OpenAPI description is at /api/v1/openapi.json.

MethodPathDescription
GET/api/v1/meYour plan, numbers, inboxes and monthly usage
GET/api/v1/smsList SMS (query: direction, contact, since_seconds, limit)
POST/api/v1/smsSend an SMS: { to, body, from? }
GET/api/v1/sms/{id}Read one SMS
GET/api/v1/emailsList emails (query: direction, unread_only, since_seconds, limit)
POST/api/v1/emailsSend an email: { to, subject, text, html?, from?, reply_to_id? }
GET/api/v1/emails/{id}Read one email (marks it read)
GET/api/v1/emails/{id}/rawDownload the original .eml
POST/api/v1/wait-for-codeWait for an OTP: { channel?, timeout_seconds?, from_contains?, since_seconds? }
GET/api/v1/callsList calls and voicemail transcripts
POST/api/v1/callsPlace a call that speaks a message (Pro, if enabled): { to, message }
curl https://agentline.nz/api/v1/sms \
  -H "Authorization: Bearer $AGENTLINE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to":"+64211234567","body":"Kia ora! Your table for 2 at 7pm is confirmed."}'

One-time codes

Every inbound SMS and email is scanned for a one-time code. wait_for_code returns the newest code that hasn't already been handed out, waiting if needed. Use from_contains to match a sender (for example "Google" or "noreply@github.com") when several codes may arrive at once.

curl -X POST https://agentline.nz/api/v1/wait-for-code \
  -H "Authorization: Bearer $AGENTLINE_KEY" -H "Content-Type: application/json" \
  -d '{"channel":"any","timeout_seconds":45}'
# → {"found":true,"code":"482913","channel":"sms","from":"+6421…","receivedAt":"…"}

SMS rules

  • Numbers are NZ 028 business messaging numbers. SMS goes to standard NZ mobile numbers only (020–029), not landlines, short codes, premium or international numbers.
  • Transactional and assistant messages only: replies, bookings, confirmations, reminders people asked for, and codes. Marketing, promotions and bulk texts are blocked.
  • Allowances are counted in segments: 160 characters (153 per part when split), or 70 (67) with emoji or macrons.
  • Delivery receipts aren't available from the carrier, so a sent message shows sent, not delivered.

Errors and limits

Errors return {"error":{"code":"…","message":"…"}} with an HTTP status:

  • 401 missing or invalid API key · 402 subscription or allowance needed · 403 opted-out recipient or suspended account
  • 409 number_pending: your 028 number hasn't been assigned yet (usually within one business day)
  • 422 content blocked by a safety check, including content_marketing for promotional SMS (the message explains why) · 429 rate limited (see Retry-After)

Limits per account: 120 API requests a minute per key; 10 SMS a minute and 150 a day; 25 new SMS recipients a day; 10 emails a minute and 200 a day; 5 calls an hour. Monthly plan allowances apply on top.