{"openapi":"3.1.0","info":{"title":"Relay.chat API","version":"0.1.0","description":"API for an assistant to read and, if the key allows it, write on a personal WhatsApp. Send limits belong to the number, not the key. There are no sends to lists. The key goes in Authorization: Bearer and must live in an environment variable, never inside the instructions. Hosted assistants can also sign in with OAuth at the MCP URL."},"servers":[{"url":"https://api.getrelay.chat"}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"An enl_… key for one number, or an OAuth access token."}}},"security":[{"bearer":[]}],"paths":{"/v1/me":{"get":{"summary":"Number, permission, and usage for this key","responses":{"200":{"description":"Number status and today's counters."}}}},"/v1/limits":{"get":{"summary":"Current limits and how much has been used","responses":{"200":{"description":"Effective policy and counters."}}}},"/v1/chats":{"get":{"summary":"Chat list","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","default":30,"maximum":50}},{"name":"offset","in":"query","schema":{"type":"integer","default":0}}],"responses":{"200":{"description":"Recent chats. Relay.chat does not store this content."}}}},"/v1/chats/{chatId}/messages":{"get":{"summary":"Messages in one chat","parameters":[{"name":"chatId","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","default":20,"maximum":50}}],"responses":{"200":{"description":"Messages read live. They are not archived in Relay.chat."}}}},"/v1/messages":{"post":{"summary":"Send a text to one chat","description":"Requires send scope. Refuses lists, broadcasts, more than one recipient, and the same text to 5 or more chats in 10 minutes. Those rules cannot be turned off. Also limits new conversations to 30 per hour: a chat with no messages, or one whose last message is more than 24 hours old. Applies per-minute and per-day caps and a longer pause for the first message to a new contact. Caps belong to the WhatsApp number.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["chatId","text"],"properties":{"chatId":{"type":"string","examples":["5215512345678@c.us"]},"text":{"type":"string","maxLength":4096}}}}}},"responses":{"200":{"description":"Sent."},"400":{"description":"Invalid chat or a bulk send attempt."},"403":{"description":"The key is read-only."},"409":{"description":"WhatsApp is not linked."},"429":{"description":"The number hit a limit."}}}},"/v1/webhooks":{"get":{"summary":"List webhooks","responses":{"200":{"description":"Registered URLs, without the secret."}}},"post":{"summary":"Register a webhook","description":"The secret is returned only once. Deliveries include X-Relay-Signature: sha256=<hmac>.","responses":{"201":{"description":"Created. Save the secret."}}}},"/v1/webhooks/{id}":{"delete":{"summary":"Delete a webhook","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deleted."}}}},"/mcp":{"post":{"summary":"MCP server (JSON-RPC) with the same keys, OAuth, and permissions","responses":{"200":{"description":"JSON-RPC response."},"401":{"description":"WWW-Authenticate points at the OAuth metadata."}}}}}}