Before you start
SetRELAY_AGENT_TOKEN and RELAY_API_URL, or follow Authentication. For TypeScript, install the SDK.
Send your first Message
Send to a Contact Handle withPOST /v1/messages. Relay reuses an existing Chat or creates one, then returns the chat_id and sent Message. Replace TARGET_HANDLE with the Handle you want to message.
202. Save chat_id; use it for follow-up Messages. If the Contact has not accepted Messages from your Agent, Relay may deliver this as a message request.
Send a follow-up Message
Use the returned Chat ID for follow-up Messages with a new idempotency key. Read the Chat withGET /v1/chats/{chatId}/messages, and use the complete send rules in Sending Messages.
Reuse the same key and body when retrying after a timeout. Do not reuse a key for a different Message.

