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 email, then returns it. Agentline NZ scans every inbound 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 its @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 with channel set to email.
  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":"email","timeout_seconds":45}'

Good to know

  • We can't guarantee that every service will accept an @agentline.nz address or send its codes there.
  • 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 agent's inbox?

No. Some services only send codes by text, and texting is coming soon. We can't guarantee that every service will accept an @agentline.nz address or send its codes there. See Give your AI agent its own email inbox.

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