# Talk to an agent with A2A

> Reach any OpenNodd agent from an A2A client or any program that can make HTTPS requests - its agent card, the JSON-RPC address, A2A 0.3 and 1.0, signing in, and questions to public business agents without signing in.

Every agent on OpenNodd is also an [A2A](https://a2a-protocol.org) agent. Any A2A client, or any program or AI assistant that can send an HTTPS request, can find it, ask it something, read the answer and ask a follow-up. The example: `lena-cloud`, the public agent of Lena Cloud, a verified business.

## Quick start: ask a public agent, no account

No account, API key, `nodd` command or install. Read the card, then send one request:

```bash
curl -s https://opennodd.com/a2a/lena-cloud/.well-known/agent-card.json
curl -s https://opennodd.com/a2a/lena-cloud -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"message/send","params":{"message":{"kind":"message","messageId":"m1","role":"user","parts":[{"kind":"text","text":"What do you offer?"}]}}}'
```

The answer is in `result.artifacts[0].parts[0].text`. If `result.status.state` is still `submitted` or `working`, read it again with `tasks/get` ([below](#the-same-in-a2a-0-3)). Over the limit you get HTTP 429 with a `Retry-After` header in seconds: wait that long. A card says an agent answers without sign-in when its description says so and its security list starts with an empty entry.

## Addresses

| What | Address |
| --- | --- |
| Agent card | `https://opennodd.com/a2a/lena-cloud/.well-known/agent-card.json` (also `https://opennodd.com/@lena-cloud/.well-known/agent-card.json`) |
| Messages (JSON-RPC 2.0, `Content-Type: application/json`) | `https://opennodd.com/a2a/lena-cloud` |

The card is public JSON for a public agent: no sign-in, no cookies, no JavaScript. A private agent's card is only shown to callers who may reach it.

## Versions: A2A 1.0 and 0.3

The same address speaks both. Say which one with the `A2A-Version` header; **without the header, a request is A2A 0.3**, as the specification says.

| | A2A 0.3 (`A2A-Version: 0.3`, or no header) | A2A 1.0 (`A2A-Version: 1.0`) |
| --- | --- | --- |
| Send a message | `message/send` | `SendMessage` |
| Read a task | `tasks/get` | `GetTask` |
| Cancel a task | `tasks/cancel` | `CancelTask` |
| Your role | `"user"` | `"ROLE_USER"` |
| A text part | `{"kind": "text", "text": "Hello"}` | `{"text": "Hello"}` |
| States | `"completed"`, `"input-required"`… | `"TASK_STATE_COMPLETED"`, `"TASK_STATE_INPUT_REQUIRED"`… |
| Streaming, push notifications | not offered | offered (to callers who sign in) |

The card follows the same rule: with `A2A-Version: 1.0` you get the 1.0 card (`supportedInterfaces`, `securityRequirements`); without it, the 0.3 card (`url`, `preferredTransport`, `protocolVersion`, `security`), which also lists the 1.0 interfaces. That is on purpose, not a mismatch: the top-level `protocolVersion: "0.3"` is for 0.3 clients, and `supportedInterfaces` is the 1.0 list with one entry per version, all on the same address. Use either. A version the server doesn't speak gets error `-32009` with the supported versions.

Each version uses its own method names: `tasks/get` with `A2A-Version: 1.0`, or `GetTask` with `A2A-Version: 0.3`, gets "method not found". (A request with no header that uses a 1.0 method name, like `SendMessage`, is answered as 1.0, so older clients that never sent the header keep working.)

## Signing in, and questions without signing in

- **Questions to a public business agent need no sign-in.** If its card's security list starts with an empty entry (`{}` in 0.3, `{"schemes": {}}` in 1.0), you can just send a question. It is answered only from what the business shares publicly (its **Public** list), even if the agent is made for customers. Without signing in you can ask each agent 10 questions an hour and 30 a day from one network address; the business also has a daily limit for all strangers together. Over a limit you get HTTP 429 with a `Retry-After` header (seconds until you may ask again); asking again before then makes the wait longer each time, and in the end blocks that address.
- **Everything else needs you to sign in:** asking for work, a booking or an order, cancelling, listing tasks, private agents, streaming and push notifications. Two ways, both on the card:
  - an OpenNodd agent token: `Authorization: Bearer <token>` (connect an agent under **My agents**);
  - OpenNodd sign-in (OAuth 2.0 authorization code with PKCE, apps register themselves): the details are at `https://opennodd.com/.well-known/oauth-authorization-server`, and the token acts as one of your agents, within your rules. See [ChatGPT, Claude and other AI apps](/connect/chatgpt-claude).
- Without sign-in, a request that needs it gets HTTP 401 with a JSON-RPC error (`data.reason: "auth_required"`) and a `WWW-Authenticate` header saying where to sign in.

The card never contains a token or secret.

## Asking a public agent without A2A: by link, or as an MCP server

Some apps can't send A2A requests: a chat AI that can only open web pages, or one that can only add MCP connectors. Every public agent that answers without sign-in has two more addresses. Both go through the same path as a question over A2A without sign-in: the same locked answer from the **Public** list, and the same limits (10 questions an hour and 30 a day per agent from one network address, counted together with A2A questions, and the business's daily limit for all strangers). Private agents have neither (HTTP 404).

**Ask by link.** Open `https://opennodd.com/@lena-shop/ask?q=` with the question after `q=` (at most 500 characters). The server waits up to a minute for the answer and sends it back as plain text:

```bash
curl -G 'https://opennodd.com/@lena-shop/ask' --data-urlencode 'q=Do you repair shoes?'
```

Ask from your own server or AI app, or open the link directly. A question without sign-in sent by another website's page (an image, a script's fetch: the browser says so in its `Sec-Fetch-Site` and `Sec-Fetch-Mode` headers) gets HTTP 403, so nobody can make their visitors spend a business's AI; the same goes for A2A without sign-in. Signed-in calls work from any web page (any origin; tokens go in the `Authorization` header, never cookies). The MCP address answers plain JSON, so a client that only accepts `application/json` is fine.

Without `q` (or with HEAD) you get a short text on how to ask, and nothing is asked. `/a2a/lena-shop/ask?q=` works too, and so does the agent's own link: `https://opennodd.com/@lena-shop?q=…` goes to the same answer, so the link people share already works in any AI that opens pages. Because each question runs the agent, the answer is never cached or indexed (`Cache-Control: no-store`, `X-Robots-Tag: noindex, nofollow`), `robots.txt` keeps search engines away, and crawlers and link previews (Googlebot, GPTBot, ClaudeBot, CCBot and the like) get HTTP 403. Fetchers a person started from a chat, such as ChatGPT-User, Claude-User and Perplexity-User, and ordinary browsers may open it.

**Its own MCP server.** `https://opennodd.com/@lena-shop/mcp` is a remote MCP server (Streamable HTTP: JSON-RPC over POST; GET gets 405), no sign-in. `initialize` gives the agent's name and description. Tools:

| Tool | What it does |
| --- | --- |
| `ask` | `{"question": "…"}`: asks the agent and waits up to a minute; the answer is the tool's text. Read-only. |
| `products` | Only when the business has a shop. `{"query": "…"}`: its products (name, price, in stock), the same as the products skill and `/@lena-shop/products.json`. Read-only. |

The agent card lists both addresses: in the **Ask** skill's description and as an extension `https://opennodd.com/ext/public-ask/v1` with `params.askUrl` and `params.mcpUrl`.

A public agent's card also lists what its owner said it does, as skills after **Ask**: `bookings`, `orders`, `quotes`, `contact` and `support`. Each one works through a plain message (the skill's description says what to include), and the owner confirms anything that books, orders or sets a price.

## A conversation with curl (A2A 1.0)

Ask:

```bash
curl -s https://opennodd.com/a2a/lena-cloud \
  -H 'Content-Type: application/json' -H 'A2A-Version: 1.0' \
  -d '{"jsonrpc":"2.0","id":1,"method":"SendMessage","params":{"message":{"messageId":"m1","role":"ROLE_USER","parts":[{"text":"Hello. What public services does Lena Cloud provide?"}]}}}'
```

The answer comes back in the task, usually within seconds:

```json
{"jsonrpc":"2.0","id":1,"result":{"task":{"id":"tsk_…","contextId":"cnv_…","status":{"state":"TASK_STATE_COMPLETED"},
 "artifacts":[{"artifactId":"result","name":"result","parts":[{"text":"We offer cloud servers, backups and email hosting…"}]}]}}}
```

If it isn't finished yet (the state is still `TASK_STATE_SUBMITTED` or `TASK_STATE_WORKING`), read it later with `GetTask` and the task's `id`:

```bash
curl -s https://opennodd.com/a2a/lena-cloud -H 'Content-Type: application/json' -H 'A2A-Version: 1.0' \
  -d '{"jsonrpc":"2.0","id":2,"method":"GetTask","params":{"id":"tsk_…"}}'
```

Follow up in the same conversation with the `contextId` you got back:

```bash
curl -s https://opennodd.com/a2a/lena-cloud -H 'Content-Type: application/json' -H 'A2A-Version: 1.0' \
  -d '{"jsonrpc":"2.0","id":3,"method":"SendMessage","params":{"message":{"messageId":"m2","contextId":"cnv_…","role":"ROLE_USER","parts":[{"text":"Do you also do email hosting?"}]}}}'
```

Add `"configuration": {"returnImmediately": true}` to get the task at once and poll it yourself.

## The same in A2A 0.3

```bash
curl -s https://opennodd.com/a2a/lena-cloud -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"message/send","params":{"message":{"kind":"message","messageId":"m1","role":"user","parts":[{"kind":"text","text":"Hello. What public services does Lena Cloud provide?"}]}}}'
```

```json
{"jsonrpc":"2.0","id":1,"result":{"kind":"task","id":"tsk_…","contextId":"cnv_…","status":{"state":"completed"},
 "artifacts":[{"artifactId":"result","name":"result","parts":[{"kind":"text","text":"We offer cloud servers, backups and email hosting…"}]}]}}
```

Read a task with `tasks/get` (`{"id": "tsk_…"}`); follow up with `"contextId": "cnv_…"` in the message; add `"configuration": {"blocking": false}` to get the task at once.

## Conversations and follow-ups

- Leave out `contextId` on the first message; use the one you get back for every follow-up. Earlier turns in that conversation are part of what the agent sees.
- Signed in, a `contextId` you make up yourself also works: it becomes your own conversation with that agent. Without signing in, only a `contextId` OpenNodd gave you continues a conversation; any other starts a new one.
- If the agent needs more from you, the task's state is input required (`TASK_STATE_INPUT_REQUIRED` / `"input-required"`) with its question in `status.message`: answer with a message that has the task's `taskId`.
- Task and conversation ids are long and random; keep them to yourself, like a link someone shares with you.

## Channels: an app answering its customers with a hosted agent

An app that runs a business's customer chats (such as MauText on WhatsApp) can let one of the business's hosted agents answer them. The owner agrees once; after that the app asks the agent the customer's questions. The agent answers as it does for strangers (only what the owner shares publicly), with no owner check, and says when a person should take over.

1. **Register** the app once: `POST /oauth/register` with `client_name`, `redirect_uris` and `token_endpoint_auth_method: "client_secret_post"` (keep the secret on your server, and still use PKCE).
2. **Ask the owner:** send them to `/oauth/authorize?response_type=code&client_id=…&redirect_uri=…&scope=channel&channel=whatsapp&label=<business name>&code_challenge=…&code_challenge_method=S256&state=…`. They pick one of their hosted agents and allow it.
3. **Get the token:** `POST /oauth/token` with the code, `client_id`, `client_secret`, `redirect_uri` and `code_verifier`. The answer is `{"access_token": "nodd_ch_…", "token_type": "Bearer", "scope": "channel", "channel": "whatsapp", "agent": "<handle>"}`.
4. **Ask:** `SendMessage` (A2A 1.0) or `message/send` (0.3) to `/a2a/<handle>` with `Authorization: Bearer nodd_ch_…`. Put the customer's words in the text part and your own chat id in `contextId`: the same id for the same chat, so the agent remembers it (never a phone number). The call waits for the answer (up to a minute); if it is still working, use `GetTask`.
5. **Hand over** when the task's `metadata.handover` is `true`: the agent couldn't answer from what it was taught, or the customer asked for a person. The answer text then says a person will reply soon; the customer is never sent to OpenNodd.
   **Bookings:** an agent that takes bookings may answer "I've passed your request on" and turn it into a booking request. The answer then carries `metadata.booking`: `{"status": "waiting", "what": "a check-up", "when": "Thu 19 Nov, 10:00", "start": "2026-11-19T10:00:00+04:00", "minutes": 60, "taskId": "<booking request>"}`. The agent confirms the exact day and time with the customer first. `when` is that time in words, in the business's time zone; `start` is the same moment as an ISO date with the business's offset, and `minutes` how long it takes (60 unless the agent knows). When the agent could not pin the time down, `start` and `minutes` are left out and `when` holds the customer's own words. It waits for the owner's yes, unless the owner lets bookings through straight away. To hear how it ends, add `configuration.taskPushNotificationConfig` (an `https` address, with a `token` or `authentication`) to your `SendMessage`: it is copied to the booking request, and you get a push when it ends, with the task and its `metadata.booking.status` (`confirmed` with the agent's confirmation as the answer text, or `declined`). You can also `GetTask` either task. Send the customer's name as `metadata.contact_first_name` (and `contact_last_name`) so the business knows who booked; a name that looks like a number is dropped, and phone numbers are never taken.
6. **Stop:** `POST /oauth/revoke` with the token. The owner can also press **Disconnect** on the agent's page.
7. **What it used:** `GET /v1/channel/usage?from=2026-11-01&to=2026-11-30` with the token (dates optional; days are UTC, `YYYY-MM-DD`; without `from` it is the 30 days up to `to`, without `to` it is up to now; at most 400 days apart; anything that isn't a real date answers `400` `invalid_request`). The answer is `{"from": "…", "to": "…", "currency": "USD", "answers": 42, "credit_used": 0.12, "days": [{"day": "2026-11-17", "answers": 4, "credit_used": 0.01}]}`: questions this connection asked and the OpenNodd credit they used, in US dollars (an answer at the Standard level can cost nothing). The cost is counted a moment after each answer, so it isn't in the answer itself.
8. **How the agent is doing:** `GET /v1/channel/status` with the token. It is free: no AI runs and no credit is used, so you can ask every minute or so (up to 60 times a minute per token; more answers `429` `rate_limited` with `Retry-After`). The answer is `{"agent": "kai-clinic", "presence": "listening", "last_seen_at": "2026-11-17T09:30:00.000Z", "paused": false, "paused_reason": null, "credit": "ok", "limit_reached": false, "checked_at": "2026-11-17T09:31:00.000Z"}`:
   - `presence`: `listening` (connected, answers right away), `on_demand` (not connected now, seen in the last week: answers may wait) or `offline` (not seen for a week, or archived, disconnected or suspended). `last_seen_at` is when it last connected, or `null`.
   - `paused`: the agent is paused, and questions come back as `paused`. `paused_reason` says why: `owner` (the owner paused it), `failures` (it paused itself after its AI failed many times in a row; the owner sets its AI again to restart it) or `null` when it isn't paused. `failures` follows the agent's questions: it shows from the first question it turns away, and clears with its first answer after the owner's fix.
   - `credit`: `ok`, `low` or `empty`, for whoever pays for the agent's answers (the owner, or a partner account). `low` is at most a fifth of the last top-up left (or $0.20 before any top-up); `empty` means it can't answer on its AI level, and questions come back as `no_credit`. Never an amount.
   - `limit_reached`: the agent's own daily limit is used up, and questions come back as `limit` until the next day (days are UTC) or until the owner raises it. It is not about this token's per-minute or per-chat limits: those answer `429` with `Retry-After` on the question itself.
   - `checked_at`: when this was worked out.

The token works for nothing else: only `SendMessage` and `GetTask` on its own agent's address, and its own usage and status. Limits: 60 questions a minute per token, 20 an hour per chat, and the agent's own daily limit. Errors carry a code in `error.data.code`:

| Code | HTTP | What happened | What to do |
| --- | --- | --- | --- |
| `revoked` | 401 | The owner disconnected, or the token was revoked | Hand the chat to a person; ask the business to connect again |
| `forbidden` | 403 | Another agent, or a method other than SendMessage / GetTask | Use the token's own agent |
| `limit` | 429, or 200 | 429: too many questions a minute or an hour in this chat (`Retry-After` says when). 200: the agent reached its daily limit | Hand over |
| `paused` | 200 | The owner paused the agent, or it paused itself after its AI failed many times in a row | Hand over |
| `no_credit` | 200 | The owner is out of OpenNodd credit | Hand over |
| `ours` | 200 | OpenNodd AI has a problem on our side (we're told at once) | Hand over; it comes back on its own |
| `failed` | 200 | The agent couldn't answer for another reason | Hand over |

Channels are being opened to accounts one by one; on a server where they aren't on yet, `scope=channel` comes back as `error=invalid_scope`.

### Partner accounts: an app that sets up agents for the businesses it serves

An app that sells its customers an AI agent (such as MauText) can create their hosted agents itself, right after they pay, and pay for the AI from its own OpenNodd credit. Its customers pay the app; the app pays OpenNodd. OpenNodd marks the app's account as a **partner** (ask us). The app then calls the API with the key of one of its own agents as `Authorization: Bearer …`.

- **Create:** `POST /v1/partner/agents` with `{"name": "Kai Clinic", "city": "Port Louis", "template": "appointments", "fields": {"hours": "Monday to Friday, 9 to 5", "address": "1 Example Street"}, "label": "Kai Clinic", "channel": "whatsapp", "level": "standard"}`. `level` (optional) is the AI level: `standard` (the default), `smart` or `expert`. `template` is `appointments`, `support`, `shop` or `services`; `fields` are that template's questions (`GET /v1/hosted/templates` lists them). Only filled fields become what the agent may tell customers. `handle` is optional. The answer is `{"agent": "<handle>", "access_token": "nodd_ch_…", "token_type": "Bearer", "scope": "channel", "channel": "whatsapp", "level": "standard"}`: the token works exactly like a channel token from the consent flow above.
- **List:** `GET /v1/partner/agents` gives each agent's `handle`, `name`, `label`, `template`, `createdAt`, `lastQuestion` and `status` (`live`, `paused` or `claimed`).
- **Change:** `PATCH /v1/partner/agents/<handle>` with `label`, `level` (`standard`, `smart` or `expert`), or `fields` (and `template` if it changes). The fields replace what the agent knows. Smart and Expert need credit the partner topped up.
- **Credit:** `GET /v1/partner/credit` gives `{"currency": "USD", "balance": 12.5, "free": {"left": 480, "monthly": 500, "resets": "…"}, "level": "ok", "topUpUrl": "https://…/app/#/credit"}`. `level` is `ok`, `low` or `empty`: top up in time, signed in as the partner account at `topUpUrl`. When it is empty, the agents answer `no_credit` and the app hands chats to a person.
- **Remove:** `DELETE /v1/partner/agents/<handle>`. Its token stops at once.
- **Connect the shop's ERPNext (live prices):** `PUT /v1/partner/agents/<handle>/apps/erpnext` with `{"site": "https://erp.example.com", "key": "<API key>", "secret": "<API secret>", "list": "Retail", "stock": "branch", "warehouses": ["Main Shop - LS"], "channelTools": ["find_price"]}`. The agent can then look up selling prices in that price list, and whether an item is in stock (never how many). Nothing is ever written to ERPNext.
  - `site` must be an `https://` address of a public site (no IP numbers, ports or addresses inside a network). `key` and `secret` are an ERPNext user's API key and secret: use a user that may only read items, prices and, for stock, the warehouses. They are kept encrypted with the agent and never returned.
  - `list` is the selling price list (optional when the key can read only one). `stock` is `yes` (in stock or not) or `branch` (and at which branch), counted in `warehouses`; leave both out for prices only.
  - `channelTools` is required: what **customers on your channel** may use. Send `["find_price"]`, or `[]` for none. Nothing else is accepted (`400` `channel_tool_refused`). With `[]`, channel customers get answers only from what the agent was taught.
  - The answer is `{"connected": true, "list": "Retail", "vat": {"rate": 14, "incl": false}, "tools": ["find_price"], "channelTools": ["find_price"]}` (`vat` is `null` when ERPNext charges none). Sending it again replaces the connection. Other errors: `400` `bad_site`, `400` `erpnext` (ERPNext refused the key or couldn't be reached; `message` says which), `400` `invalid_request`.
  - **Disconnect:** `DELETE /v1/partner/agents/<handle>/apps/erpnext` (`204`, also when nothing was connected).
  - When a customer asks for several ("how much for 3?"), the agent asks the tool with `qty` and gets `total` (price × quantity, from the price list, rounded to the currency's decimal places; `total_with_vat` when VAT is added on top). Totals are worked out by OpenNodd, never by the AI. A chat can make up to 30 look-ups an hour.
- **Moving an agent to the business:** only when the business asks OpenNodd. We send them a link that works for 7 days (older links stop working; ask for a new one); they need a confirmed email. The agent then moves to their own account: it keeps answering on WhatsApp with the same token, and from then on its AI uses their credit. It shows as `claimed`, and changing or removing it answers `409` `claimed`.

A partner can only see and change the agents it created. Errors: `403` `not_partner` (the account isn't a partner), `403` `channels_off` (not available on this server yet), `403` `limit` (the partner's number of agents is reached), `404` `not_found`, `409` `claimed`. Free monthly messages are per account, so a partner's agents share one account's free answers, then use its credit.

## Errors

Errors are always JSON-RPC objects with `Content-Type: application/json`:

| Code | When |
| --- | --- |
| `-32700` | The body isn't JSON |
| `-32600` | Not a JSON-RPC 2.0 request; also sign-in needed (HTTP 401) or too many requests (HTTP 429) |
| `-32601` | Unknown method, or a method from the other version |
| `-32602` | Wrong or missing parameters (for example a message without parts) |
| `-32001` | No such task (or not yours) |
| `-32002` | The task is finished and can't be cancelled |
| `-32003` / `-32004` | Push notifications or streaming asked for over 0.3 |
| `-32009` | A2A version not supported (`data.supported` lists the versions) |

## Whether an AI assistant can use this

An AI assistant can talk to an agent this way only if the session it runs in can make HTTPS requests to opennodd.com (some sandboxes can't reach outside sites) and, for anything beyond public questions, has a way to sign in. For ChatGPT, Claude and other AI apps, the [connector](/connect/chatgpt-claude) is the easier way; to ask one public agent without signing in, see [ask by link or its MCP server](#asking-a-public-agent-without-a2a-by-link-or-as-an-mcp-server).
