Skip to content
API reference
Browse the API reference

From an agent or a script

Let a deploy script, a nightly job or an AI agent stop and ask you first, then go on with your answer. All three ways below use an nlk_ key: in the Nowlark app on iPhone or Mac, open Settings › Connect an App › Create Your Key. A personal key reaches only your own devices, a channel key reaches that channel's team, and you can revoke either one in the app at any time.

The command line. Download the client into a folder on your PATH and set the key:

curl -fsSL https://nowlark.com/clients/nowlark -o ~/bin/nowlark && chmod +x ~/bin/nowlark
export NOWLARK_API_KEY=nlk_your_key

Next to plain sends it has:

nowlark ask Deploy "Ship 1.4 to production?" --replies approve_deny --pass-on approve --wait 1800 && ./deploy.sh
nowlark wrap "Nightly backup" --on failure -- ./backup.sh --full
nowlark open

Deploy is the sender name shown on the phone and --wait is in seconds. ask prints the answer (approve, deny, yes, no, later, or your own text). With --pass-on it exits 0 only for the answers listed, ignoring case, and 1 for any other, so the deploy above runs only on Approve. Without --pass-on, any answer exits 0. Nobody answering exits 3, and the question closes on the phone when the wait ends, so a late tap is refused and can never approve a script that has stopped. wrap runs the command, sends how it went (exit code, time taken, its last lines) and exits with the command's own code; --on failure sends only when it fails. open lists what GET /v1/open returns.

AI agents (MCP). MCP is how an agent such as Claude Code calls outside tools. The Nowlark MCP server is one file that needs only Python 3.9 or later:

curl -fsSL https://nowlark.com/clients/nowlark-mcp.py -o ~/nowlark-mcp.py
claude mcp add nowlark --env NOWLARK_API_KEY=nlk_your_key -- python3 ~/nowlark-mcp.py

Other MCP clients that start a local server over stdio run python3 ~/nowlark-mcp.py with NOWLARK_API_KEY in its environment. The agent gets four tools: send; ask (question, details, replies, wait), which waits up to 10 minutes for the answer; get_answer, which checks a question again after ask stopped waiting; and list_open. A question ask stopped waiting on stays open on the phone, 7 days unless answer_within sets less, and no answer is never read as approval. Tell the agent when to use it, for example "ask me through Nowlark before you deploy or delete anything". Set NOWLARK_SOURCE to name the sender on the phone.

GitHub Actions. The Nowlark Notify and Ask action sends from a workflow, or holds a job until someone answers. Save the key as a repository secret named NOWLARK_API_KEY first (Settings › Secrets and variables › Actions):

- uses: Skail-Consulting-LLC/nowlark-action@v1
  id: ask
  with:
    api-key: ${{ secrets.NOWLARK_API_KEY }}
    title: Deploy ${{ github.repository }} to production?
    ask: approve_deny
    pass-on: approve
    wait: 1800
- run: echo "Answered ${{ steps.ask.outputs.answer }}"

The step waits wait seconds (default 900), puts the answer in the answer output and fails on any answer not in pass-on, or on no answer. The question closes on the phone when the wait ends. It runs on Linux and macOS runners, which include python3.