How does wait_for_code get one-time codes for my agent?

Checked · Markdown

Short answer

wait_for_code waits up to 55 seconds for a one-time code to arrive by SMS or email, then returns it. Agentline NZ scans every inbound SMS and email for a one-time code and hands back the newest code that hasn't already been returned, so your agent doesn't have to poll.

Steps

  1. Give the service your Agentline NZ details. Your agent enters your Agentline NZ 028 number or @agentline.nz email address in the sign-up or sign-in form.
  2. Call wait_for_code. Straight after submitting the form, the agent calls wait_for_code. Set channel to sms, email or any.
  3. Narrow it down if needed. If several codes might arrive at once, pass from_contains with part of the sender, for example Google or noreply@github.com.
  4. Use the code. wait_for_code returns the code, the channel, the sender and when it arrived. The agent types it in to finish.

REST API example

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}'

Good to know

  • We can't guarantee that every third-party service will accept an Agentline NZ number for verification.
  • Each code is only handed out once, so two agents waiting on the same account won't both get it.

FAQ

Will every service send codes to my number?

No. Some services won't send codes to business messaging numbers. We can't guarantee that every third-party service will accept an Agentline NZ number for verification. See Can an AI agent receive SMS verification codes in New Zealand?.

Start free · Start free with an email inbox (no card), or take a 7-day trial of Starter or Pro to get a number.