LunaDocs

Loading search...

PortuguêsSign in to the console
On this page

API reference

Use with AI

Every route of the public API, generated from the OpenAPI specification the API itself serves. Each operation says how to call it: the scope, the parameters, the body, the responses and examples in curl, Node and Python. To understand the reason behind a decision, follow the guide link on each operation.

Groups#

Authentication#

Base URL: https://api.lunahia.com.br

Every integration route asks for an API key in the Authorization header, in the form Bearer hlsn_.... The public routes, which each operation’s page marks, ask for no key.

The key carries scopes. Each operation says the scope it demands, and a key without it gets 403. With no key, or with an invalid or revoked one, the answer is 401. The key shows exactly once, when it is created. The step by step to create and revoke keys, with curl, is in Account and keys.

Sending a message is asynchronous: the answer is 202, and Luna delivers to Meta at the pace it allows. The result arrives as a webhook event, at your endpoint.

There is a request limit per API key. It is technical, the same for every customer, and the 429 answer carries Retry-After with the time to wait.

Every error returns a JSON body with error (a stable code) and message (text for a person to read). Decide by the status and by error, never by the text of message. The errors page lists the codes.

Download#