{
  "info": {
    "name": "Luna: WhatsApp messaging API",
    "description": "Collection generated from the Luna OpenAPI specification. Fill the apiKey variable with your API key. The full reference is at https://lunahia.com.br/en/docs/reference.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{apiKey}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://api.lunahia.com.br"
    },
    {
      "key": "apiKey",
      "value": "hlsn_YOUR_KEY_HERE"
    }
  ],
  "item": [
    {
      "name": "Messages",
      "description": "Send messages and read what came in and went out. Sending is asynchronous: the answer is 202 and delivery happens at the pace Meta allows.",
      "item": [
        {
          "name": "List messages",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/messages",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "messages"
              ]
            },
            "description": "The record of what came in and what went out, newest first. Each message carries the number, the customer label, the conversation and, when it failed, the error summary. Filters: phoneNumberId, externalId, conversationId, waId, userId, wamid, direction, status, since and until. A parameter the route does not know answers 400. format=csv answers text/csv, with the same filters.\n\nRequired scope: messages:read"
          },
          "response": []
        },
        {
          "name": "Send a text message",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/messages",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "messages"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"from\": \"1000000000000001\",\n  \"to\": \"5511900000000\",\n  \"text\": {\n    \"body\": \"Olá! Recebemos seu pedido e já estamos preparando.\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Accepts the message, returns 202 with its identifier, and delivers it to Meta asynchronously. With a test key, the message does NOT go to Meta: Luna returns the 202 and delivers the simulated states sent, delivered and read to your webhook, with test: true. The optional Idempotency-Key header (1 to 255 visible characters, no space) makes repeating the request return the original message; empty or malformed answers 400.\n\nRequired scope: messages:write"
          },
          "response": []
        },
        {
          "name": "Mark a message as read",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/messages/:id/read",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "messages",
                ":id",
                "read"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "description": "Marks a message you received as read on Meta, and returns 200 once it accepts.\n\nRequired scope: messages:write"
          },
          "response": []
        },
        {
          "name": "Show the typing indicator",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/messages/:id/typing",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "messages",
                ":id",
                "typing"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "description": "Shows the recipient that you are writing, and returns 200 once Meta accepts.\n\nRequired scope: messages:write"
          },
          "response": []
        },
        {
          "name": "Read one message's state",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/messages/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "messages",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "description": "Returns the message's current state, the timestamp of each step, and what Meta said whenever it refused something.\n\nRequired scope: messages:read"
          },
          "response": []
        },
        {
          "name": "Cancel a message in the queue",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/messages/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "messages",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "description": "Cancels a message still in the outbound queue (accepted) and answers 204. It moves to the terminal state canceled, and the message.status event with status canceled reaches your webhook. If the message already went to Meta or has an outcome, it answers 409 message_not_cancelable with the current state.\n\nRequired scope: messages:write"
          },
          "response": []
        },
        {
          "name": "Replay a message's webhook",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/messages/:id/replay",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "messages",
                ":id",
                "replay"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "description": "Asks for this message's event to be delivered to your endpoint again: the message.received if it was received, or the latest message.status if it was sent, with the same format and the same signature as the original. The response is 202: the request was recorded, and delivery happens asynchronously. A sent message that has no state yet, or that Meta has not accepted yet, answers 400.\n\nRequired scope: webhooks:write"
          },
          "response": []
        },
        {
          "name": "Simulate a received message",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/test-mode/inbound-messages",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "test-mode",
                "inbound-messages"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"phoneNumberId\": \"YOUR_PHONENUMBERID\",\n  \"waId\": \"YOUR_WAID\",\n  \"text\": \"YOUR_TEXT\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Delivers ONE example message.received to your webhook endpoints, signed and with test: true on the envelope, so you can exercise your code without waiting for a contact to write. The message goes out in about half a second, and nothing is stored or goes through a number of yours or through Meta. It works with the test key and with the regular key.\n\nRequired scope: messages:write"
          },
          "response": []
        }
      ]
    },
    {
      "name": "Conversations",
      "description": "One row per contact per number, with the state of the 24 hour customer service window.",
      "item": [
        {
          "name": "List conversations",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/conversations",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "conversations"
              ]
            },
            "description": "One row per correspondent per number, from the most active to the most idle.\n\nRequired scope: messages:read"
          },
          "response": []
        }
      ]
    },
    {
      "name": "Media",
      "description": "Upload a file to Meta and download the media that arrived in a message.",
      "item": [
        {
          "name": "Get a message's media",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/messages/:id/media",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "messages",
                ":id",
                "media"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "description": "Returns a signed URL, issued by Luna, to download media that has already been persisted.\n\nRequired scope: messages:read"
          },
          "response": []
        },
        {
          "name": "Download media through the notice link",
          "request": {
            "method": "GET",
            "auth": {
              "type": "noauth"
            },
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/media/:token",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "media",
                ":token"
              ],
              "variable": [
                {
                  "key": "token",
                  "value": "YOUR_TOKEN"
                }
              ]
            },
            "description": "The link that comes in media.url on the message.received and message.echo notices. It asks for no API key: the token in the address is the credential. Ready media answers 302 to a short-lived signed URL; media still being downloaded from Meta, 409 with Retry-After; a token that does not exist or has expired, 404.\n\nPublic route: takes no key."
          },
          "response": []
        },
        {
          "name": "Upload a file and get its media identifier",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/numbers/:id/media",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "numbers",
                ":id",
                "media"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "file",
                  "type": "file",
                  "src": []
                }
              ]
            },
            "description": "Takes a file in multipart/form-data under the field file, uploads it to Meta and returns its identifier.\n\nRequired scope: messages:write"
          },
          "response": []
        }
      ]
    },
    {
      "name": "Templates",
      "description": "Messages pre-approved by Meta, required to start a conversation outside the 24 hour window.\n\nApproved is not cleared for volume: Meta applies a pace of its own over the first sends of a new template, and publishes no deadline and no mechanics. Ramp up your first send instead of scheduling it for a date, and watch the state of the template.\n\nAbove three buttons, only two appear in the delivered message. Meta accepts the template with more and delivers two, so the arrangement has to be decided before the flow is designed.",
      "item": [
        {
          "name": "List templates",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/templates",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "templates"
              ]
            },
            "description": "This customer's templates, newest first.\n\nRequired scope: templates:read"
          },
          "response": []
        },
        {
          "name": "Create a template",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/templates",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "templates"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"wabaId\": \"YOUR_WABAID\",\n  \"name\": \"YOUR_NAME\",\n  \"bodyText\": \"YOUR_BODYTEXT\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Creates the template in the customer's account and submits it to Meta for approval.\n\nRequired scope: templates:write"
          },
          "response": []
        },
        {
          "name": "Read a template",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/templates/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "templates",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "description": "The template's current state at Meta, the content you wrote, and what Meta announced about it.\n\nRequired scope: templates:read"
          },
          "response": []
        },
        {
          "name": "Edit a template",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/templates/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "templates",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"bodyText\": \"YOUR_BODYTEXT\",\n  \"examples\": {},\n  \"header\": \"YOUR_HEADER\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Changes the components of an existing template.\n\nRequired scope: templates:write"
          },
          "response": []
        },
        {
          "name": "Delete a template",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/templates/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "templates",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "description": "Deletes the template at Meta and from your listing.\n\nRequired scope: templates:write"
          },
          "response": []
        },
        {
          "name": "Read the template rules",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/templates/rules",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "templates",
                "rules"
              ]
            },
            "description": "The categories, the suggested languages, the name format, the maximum lengths of body, header and footer, and the button limits. It is what POST /v1/templates enforces, served so you can show the same limit without copying the number.\n\nRequired scope: templates:read"
          },
          "response": []
        },
        {
          "name": "Create an authentication template",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/templates/authentication",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "templates",
                "authentication"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"wabaId\": \"YOUR_WABAID\",\n  \"name\": \"YOUR_NAME\",\n  \"codeExpirationMinutes\": 10\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Creates an authentication template with a copy code button, and submits it to Meta for approval.\n\nRequired scope: templates:write"
          },
          "response": []
        },
        {
          "name": "Copy a template to other customers",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/templates/:id/copy",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "templates",
                ":id",
                "copy"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"targets\": [\n    {\n      \"wabaId\": \"YOUR_WABAID\",\n      \"externalId\": \"YOUR_EXTERNALID\"\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Creates a copy of the template in up to 50 destinations, each a business account (wabaId) or a customer of yours (externalId). Answers 200 with one result per destination, and a destination that fails does not bring the others down. The copy goes through the same path and the same rules as POST /v1/templates.\n\nRequired scope: templates:write"
          },
          "response": []
        },
        {
          "name": "Upload the example file for a media header",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/template-assets",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "template-assets"
              ]
            },
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "file",
                  "type": "file",
                  "src": []
                }
              ]
            },
            "description": "Takes a file in multipart/form-data under the field file and returns the handle that template creation accepts in headerMedia.handle.\n\nRequired scope: templates:write"
          },
          "response": []
        }
      ]
    },
    {
      "name": "Phone numbers",
      "description": "The connected numbers: connect, read state, quality and throughput, edit and disconnect.\n\nMigrating a number that is already on another provider's API is a supported path, and it needs no new number and loses no existing one. A number already registered on another provider's Cloud API almost always has two step verification configured there, and Meta requires the existing PIN to register it again: there is no endpoint to read or to turn that PIN off, so it has to come from the end business. Give the PIN at POST /v1/numbers/{id}/pin, or ask the end business to turn two step verification off in its WhatsApp Manager. The other prerequisites are on its side too: it has to own the WhatsApp Business account and have the number released by the previous provider.\n\nA number that today exists only in the WhatsApp Business App, the phone application, is the other case, and Meta calls it coexistence. It has never been through any API. The connection starts from the same Meta window, and the option only shows up once the end business account is enabled for it on Meta's side and the app on the device is version 2.24.17 or later.\n\nConnected this way, the number keeps working in the phone application, and the earlier conversations on the device are imported into the platform: they show up in GET /v1/messages next to the new ones. The import has a deadline to finish, and what tells you where it stands is GET /v1/numbers/{id}, in the fields sincronizacaoDoHistorico and sincronizacaoPrazo. The same resource carries tetoDeVazaoPorSegundo, which is the fixed sending speed ceiling of a number in coexistence and does not go up over time. And what the business owner answers from the phone application arrives too, in the recipient's conversation.",
      "item": [
        {
          "name": "Read the business profile",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/numbers/:id/profile",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "numbers",
                ":id",
                "profile"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "description": "The profile the contact sees on WhatsApp: about text, address, description, email, websites, vertical and the picture. It does not work on a number in coexistence.\n\nRequired scope: numbers:read"
          },
          "response": []
        },
        {
          "name": "Change the business profile",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/numbers/:id/profile",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "numbers",
                ":id",
                "profile"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"about\": \"YOUR_ABOUT\",\n  \"address\": \"YOUR_ADDRESS\",\n  \"description\": \"YOUR_DESCRIPTION\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Changes the fields you send and leaves the others as they are. With displayName, it requests the display name change and answers 202: the name stays under review at Meta. It does not work on a number in coexistence.\n\nRequired scope: numbers:write"
          },
          "response": []
        },
        {
          "name": "List blocked users",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/numbers/:id/blocked-users",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "numbers",
                ":id",
                "blocked-users"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "description": "Who this number has blocked, in pages. The cursor is Meta's, and its shape does not change.\n\nRequired scope: messages:read"
          },
          "response": []
        },
        {
          "name": "Block users",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/numbers/:id/blocked-users",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "numbers",
                ":id",
                "blocked-users"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"users\": [\n    \"YOUR_USERS\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Blocks people who wrote to the number in the last 24 hours. Each user is a phone number or a BSUID, and the response separates the ones Meta accepted from the ones it refused, with the reason.\n\nRequired scope: messages:write"
          },
          "response": []
        },
        {
          "name": "Unblock a user",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/numbers/:id/blocked-users/:user",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "numbers",
                ":id",
                "blocked-users",
                ":user"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                },
                {
                  "key": "user",
                  "value": "YOUR_USER"
                }
              ]
            },
            "description": "Unblocks a user, by the phone number or the BSUID in the path. It stays open on a suspended account: unblocking is never the problem.\n\nRequired scope: messages:write"
          },
          "response": []
        },
        {
          "name": "List the QR codes",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/numbers/:id/qr-codes",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "numbers",
                ":id",
                "qr-codes"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "description": "The codes that exist on this number, with each one's short link.\n\nRequired scope: numbers:read"
          },
          "response": []
        },
        {
          "name": "Create a QR code and a short link",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/numbers/:id/qr-codes",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "numbers",
                ":id",
                "qr-codes"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"prefilledMessage\": \"YOUR_PREFILLEDMESSAGE\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Creates a code that opens a conversation with the number, with the message already written. It returns the code, the short link and, if you asked for it, the address of the image.\n\nRequired scope: numbers:write"
          },
          "response": []
        },
        {
          "name": "Delete a QR code",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/numbers/:id/qr-codes/:code",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "numbers",
                ":id",
                "qr-codes",
                ":code"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                },
                {
                  "key": "code",
                  "value": "YOUR_CODE"
                }
              ]
            },
            "description": "Deletes the code and the short link: whoever still has the QR printed stops opening the conversation. It stays open on a suspended account.\n\nRequired scope: numbers:write"
          },
          "response": []
        },
        {
          "name": "Open a connection session",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/onboarding/sessions",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "onboarding",
                "sessions"
              ]
            },
            "description": "Creates the session that Meta's connection flow fills in, and returns the sessionId and the csrfState.\n\nRequired scope: onboarding:write"
          },
          "response": []
        },
        {
          "name": "Read a connection session",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/onboarding/sessions/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "onboarding",
                "sessions",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "description": "The session's current state and the matching guidance text, ready to display.\n\nRequired scope: onboarding:write"
          },
          "response": []
        },
        {
          "name": "Report an abandoned or failed flow",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/onboarding/sessions/:id/abandon",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "onboarding",
                "sessions",
                ":id",
                "abandon"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"csrfState\": \"YOUR_CSRFSTATE\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Telemetry about what happened in Meta's window when the flow did not complete: which screen the customer stopped on, or which error Meta reported.\n\nRequired scope: onboarding:write"
          },
          "response": []
        },
        {
          "name": "Complete the connection",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/onboarding/sessions/:id/complete",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "onboarding",
                "sessions",
                ":id",
                "complete"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"code\": \"YOUR_CODE\",\n  \"csrfState\": \"YOUR_CSRFSTATE\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Exchanges the embedded flow's code for permanent access to the customer's account, and drives the session to the end: sealed token, app subscribed to the account, phone number registered.\n\nRequired scope: onboarding:write"
          },
          "response": []
        },
        {
          "name": "List connected phone numbers",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/numbers",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "numbers"
              ]
            },
            "description": "Every WhatsApp number connected to this customer, with state, quality, sending speed and daily conversation limit. Filters: externalId (exact match), q (prefix search over externalId, label and displayNumber), state, wabaId, qualityRating, connectionStatus, ready and canSend. A parameter the route does not know answers 400.\n\nRequired scope: numbers:read"
          },
          "response": []
        },
        {
          "name": "Read one phone number",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/numbers/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "numbers",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "description": "One number, with everything the listing carries plus the health of its connection to Meta.\n\nRequired scope: numbers:read"
          },
          "response": []
        },
        {
          "name": "Edit a number",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/numbers/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "numbers",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"externalId\": \"YOUR_EXTERNALID\",\n  \"label\": \"YOUR_LABEL\",\n  \"autoRead\": true\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Changes a number's externalId and label, and turns autoRead (mark every received message as read on its own) on or off. It is how you reuse a number for another customer of yours, or name a number that was connected through the console, without a link.\n\nRequired scope: numbers:write"
          },
          "response": []
        },
        {
          "name": "Disconnect a number",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/numbers/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "numbers",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "description": "Takes the number off Luna. It is how you open a slot in the plan capacity: the number stops counting from this instant, and your customer can be swapped for another.\n\nRequired scope: numbers:write"
          },
          "response": []
        },
        {
          "name": "Give a number's two step verification PIN",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/numbers/:id/pin",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "numbers",
                ":id",
                "pin"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"pin\": \"YOUR_PIN\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Gives the two step verification PIN of a number that is already registered on another provider's Cloud API, so Luna can register it without the end business having to turn verification off.\n\nRequired scope: onboarding:write"
          },
          "response": []
        },
        {
          "name": "Reconnect a number whose authorisation died",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/onboarding/reconnect",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "onboarding",
                "reconnect"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"numberId\": \"YOUR_NUMBERID\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Opens a connection session for a number that already exists, when the authorisation granted by the customer expired or was revoked.\n\nRequired scope: onboarding:write"
          },
          "response": []
        },
        {
          "name": "List business accounts",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/business-accounts",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "business-accounts"
              ]
            },
            "description": "The WhatsApp Business accounts this customer has connected, newest first, each with its name at Meta, its WhatsApp Manager address and its numbers.\n\nRequired scope: numbers:read"
          },
          "response": []
        },
        {
          "name": "Check the account payment method at Meta now",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/business-accounts/:id/payment-method/check",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "business-accounts",
                ":id",
                "payment-method",
                "check"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "description": "Reads from Meta whether the account has a payment method on file, without waiting for the hourly read, and returns the result. The webhook notice follows the usual path: number.action_required (reason payment_method_missing) when it is missing and number.action_resolved when it shows up. A read newer than 60 seconds is returned without calling Meta, and the call respects the account call budget.\n\nRequired scope: numbers:read"
          },
          "response": []
        },
        {
          "name": "Read the health of a phone number",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/numbers/:id/health",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "numbers",
                ":id",
                "health"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "description": "The quality rating, throughput level and daily conversation limit Meta assigns to this number right now, and the changes the platform has observed over time.\n\nRequired scope: numbers:read"
          },
          "response": []
        },
        {
          "name": "Read the Meta usage of a number or a customer",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/usage",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "usage"
              ]
            },
            "description": "The usage Meta measures for a number (numberId) or for all the numbers of one of your customers (externalId), passed through as Meta reports it, with each account's currency and no sums. format=csv returns text/csv. Luna only reads and shows it: none of it goes into the Luna subscription.\n\nRequired scope: numbers:read"
          },
          "response": []
        }
      ]
    },
    {
      "name": "Connection links",
      "description": "A link your customer opens to connect their WhatsApp number, without receiving your console login. One link per customer of yours, tied to the externalId you chose.",
      "item": [
        {
          "name": "List connect links",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/onboarding/links",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "onboarding",
                "links"
              ]
            },
            "description": "The links you created, newest first, revoked ones included. Filters: externalId (exact), q (start of the externalId) and status (open, used, expired or revoked).\n\nRequired scope: numbers:read"
          },
          "response": []
        },
        {
          "name": "Create a connect link for your customer",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/onboarding/links",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "onboarding",
                "links"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"externalId\": \"YOUR_EXTERNALID\",\n  \"displayName\": \"YOUR_DISPLAYNAME\",\n  \"redirectUrl\": \"YOUR_REDIRECTURL\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Creates a link your customer opens to connect their own WhatsApp number, without being given your console login.\n\nRequired scope: onboarding:write"
          },
          "response": []
        },
        {
          "name": "Read a connect link",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/onboarding/links/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "onboarding",
                "links",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "description": "A link's state: open, used, expired or revoked, with its purpose, its last failure and what the account can do with it.\n\nRequired scope: numbers:read"
          },
          "response": []
        },
        {
          "name": "Revoke a connect link",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/onboarding/links/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "onboarding",
                "links",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "description": "Revokes the link. The url stops working at once and answers 404 to whoever opens it, like one that never existed. A connection the customer had already started in Meta's window can no longer be completed through it. The link stays in your list, with status revoked and revokedAt. Revoking an already revoked link answers 404.\n\nRequired scope: onboarding:write"
          },
          "response": []
        },
        {
          "name": "Create several connect links at once",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/onboarding/links/batch",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "onboarding",
                "links",
                "batch"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"links\": [\n    {\n      \"externalId\": \"YOUR_EXTERNALID\",\n      \"displayName\": \"YOUR_DISPLAYNAME\",\n      \"redirectUrl\": \"YOUR_REDIRECTURL\"\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Creates up to 100 links, each item in the same shape as POST /v1/onboarding/links and under the same rules, plan capacity included. Answers 200 with one result per item, with the url of each created link; an item that fails does not bring the others down.\n\nRequired scope: onboarding:write"
          },
          "response": []
        },
        {
          "name": "Generate the url of a connect link again",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/onboarding/links/:id/reissue",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "onboarding",
                "links",
                ":id",
                "reissue"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "description": "Generates a new token for the same link (same id, label and expiry): the old url stops working at once and the new one appears only in this response. Only for an open link; used, expired or revoked answers 409. Use it when your customer lost the url, instead of revoking and creating another.\n\nRequired scope: onboarding:write"
          },
          "response": []
        }
      ]
    },
    {
      "name": "Webhooks and events",
      "description": "Where Luna delivers what arrives at your number, the secret that signs those deliveries, and the event types, each with its schema and an example.",
      "item": [
        {
          "name": "List webhook endpoints",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks/endpoints",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks",
                "endpoints"
              ]
            },
            "description": "The endpoints registered for this customer, newest first, with the endpoint limit and whether another can still be registered (limit and canCreate). Each endpoint carries deliveryStatus.\n\nRequired scope: webhooks:read"
          },
          "response": []
        },
        {
          "name": "Register the webhook endpoint",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks/endpoints",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks",
                "endpoints"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"url\": \"https://exemplo.com.br/arquivo\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Registers your server's URL and returns the secret that signs the deliveries. headers, optional, carries up to 5 own HTTP headers that Luna sends on every delivery (for a gateway that requires a fixed token); the values are secret and no response returns them.\n\nRequired scope: webhooks:write"
          },
          "response": []
        },
        {
          "name": "List the event types",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks/event-types",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks",
                "event-types"
              ]
            },
            "description": "The event types Luna delivers, which eventTypes accepts when you register or update an endpoint. Each item carries the type, which is the value to send, a sentence that says what the event is, and the group it belongs to (group and groupLabel).\n\nRequired scope: webhooks:read"
          },
          "response": []
        },
        {
          "name": "Read the webhook endpoint",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks/endpoints/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks",
                "endpoints",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "description": "The endpoint's configuration.\n\nRequired scope: webhooks:read"
          },
          "response": []
        },
        {
          "name": "Update the webhook endpoint",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks/endpoints/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks",
                "endpoints",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"url\": \"https://exemplo.com.br/arquivo\",\n  \"paused\": true,\n  \"eventTypes\": [\n    \"message.received\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Changes the URL, pauses or resumes the endpoint, or changes the event types it receives. Send url, paused, eventTypes, externalIds, phoneNumberIds, headers or any combination: a body with none of them answers 400.\n\nRequired scope: webhooks:write"
          },
          "response": []
        },
        {
          "name": "Remove the webhook endpoint",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks/endpoints/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks",
                "endpoints",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "description": "Removes the endpoint. The response is 204, and the endpoint stops receiving events.\n\nRequired scope: webhooks:write"
          },
          "response": []
        },
        {
          "name": "List the endpoint's deliveries",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks/endpoints/:id/deliveries",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks",
                "endpoints",
                ":id",
                "deliveries"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "description": "The delivery attempts to the endpoint over the last 7 days, newest first: eventId, eventType, status, httpStatus (null when your server did not answer), durationMs, attempt and at. Filters: status (success or failed), eventType and since. It does not carry the body sent or what your server answered.\n\nRequired scope: webhooks:read"
          },
          "response": []
        },
        {
          "name": "Send a test event",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks/endpoints/:id/test",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks",
                "endpoints",
                ":id",
                "test"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"eventType\": \"message.received\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Sends ONE webhook.test event to the endpoint, now, and returns the result in the response itself. The event goes out signed, with the same headers, the same signature and the same destination defenses as a real delivery, so a test that passes proves that the URL and signature verification work. With eventType in the body, the event is an example of that type, with a made-up body and test: true in the envelope.\n\nRequired scope: webhooks:write"
          },
          "response": []
        },
        {
          "name": "Rotate the signing secret",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks/endpoints/:id/rotacionar",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks",
                "endpoints",
                ":id",
                "rotacionar"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"revokePrevious\": true\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Mints a new secret and returns it once. Store it now, as on registration.\n\nRequired scope: webhooks:write"
          },
          "response": []
        },
        {
          "name": "List deliveries that failed for good",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks/dlq",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks",
                "dlq"
              ]
            },
            "description": "The events Luna tried to deliver to your endpoint and gave up on, newest first, each with the number, the customer label, the attempts, the last HTTP status and what can be done with it (allowedActions). Filters: endpointId, externalId and requeued.\n\nRequired scope: webhooks:read"
          },
          "response": []
        },
        {
          "name": "Requeue a failed delivery",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks/dlq/:id/reenfileirar",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks",
                "dlq",
                ":id",
                "reenfileirar"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "description": "Puts the event back on the delivery queue. The response is 202: the request was recorded, and delivery happens asynchronously.\n\nRequired scope: webhooks:write"
          },
          "response": []
        }
      ]
    },
    {
      "name": "Keys",
      "description": "Create, list and revoke the credentials that authenticate your calls.",
      "item": [
        {
          "name": "List API keys",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/api-keys",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "api-keys"
              ]
            },
            "description": "This customer's keys, with scopes, profile, status (active, revoked or expired), creation date, last use, revocation and what the account can do with each one (allowedActions).\n\nRequired scope: keys:read"
          },
          "response": []
        },
        {
          "name": "Create an API key",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/api-keys",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "api-keys"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"label\": \"YOUR_LABEL\",\n  \"scopes\": [\n    \"keys:read\"\n  ],\n  \"profile\": \"agent\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Mints a new key and returns the secret exactly once. Store it the moment you receive it, because no route will return it again.\n\nRequired scope: keys:write"
          },
          "response": []
        },
        {
          "name": "List the scopes a key can have",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/api-keys/scopes",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "api-keys",
                "scopes"
              ]
            },
            "description": "The scopes an integration key can receive, each with its name in Portuguese, what it allows and whether it gives a power that calls for care.\n\nRequired scope: keys:read"
          },
          "response": []
        },
        {
          "name": "List the key profiles",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/api-keys/profiles",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "api-keys",
                "profiles"
              ]
            },
            "description": "The ready-made key profiles (agent, full and read_only) and the scopes each one grants. In POST /v1/api-keys, profile stands in for scopes.\n\nRequired scope: keys:read"
          },
          "response": []
        },
        {
          "name": "Read one API key",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/api-keys/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "api-keys",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "description": "One key's metadata. The secret does not come back, for the reason described on the listing route.\n\nRequired scope: keys:read"
          },
          "response": []
        },
        {
          "name": "Revoke an API key",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/api-keys/:id/revoke",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "api-keys",
                ":id",
                "revoke"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "YOUR_ID"
                }
              ]
            },
            "description": "Invalidates the key immediately. The operation is idempotent, so revoking again returns the same result without an error.\n\nRequired scope: keys:write"
          },
          "response": []
        }
      ]
    },
    {
      "name": "Account and plan",
      "description": "The credential's account, the plan, the number capacity and how many are in use in the period.",
      "item": [
        {
          "name": "Read the plan and the subscription",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/subscription",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "subscription"
              ]
            },
            "description": "The account's plan (free trial or contracted), the number capacity and how many are in use, and what Helsen charges for the period: the capacity of active numbers, and nothing beyond that.\n\nRequired scope: numbers:read"
          },
          "response": []
        },
        {
          "name": "Read the platform's technical limits",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/limits",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "limits"
              ]
            },
            "description": "The ceilings the API applies, each with its value, unit and reason. They are the same for every customer and do not depend on the plan: they exist for infrastructure capacity or because Meta imposes them. They are not a count of your usage and do not enter billing.\n\nRequired scope: numbers:read"
          },
          "response": []
        },
        {
          "name": "Read Meta's pricing rules",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/meta-pricing",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "meta-pricing"
              ]
            },
            "description": "The rules by which Meta charges for the use of WhatsApp to the business that owns the number, and the day Luna read them. It carries no monetary values: the rate table stays at Meta. Luna charges none of this.\n\nRequired scope: numbers:read"
          },
          "response": []
        },
        {
          "name": "Read your own account",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/account",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "account"
              ]
            },
            "description": "Returns the account behind the credential presented: identifier, name, whether the email has been confirmed, and when the account was created.\n\nRequired scope: numbers:read"
          },
          "response": []
        },
        {
          "name": "Rename the account",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/account",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "account"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"YOUR_NAME\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Changes the account name, the same one GET /v1/account returns. Returns the account with the new name. Only the console session does this.\n\nRequired scope: session:end"
          },
          "response": []
        },
        {
          "name": "See the account summary",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/account/overview",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "account",
                "overview"
              ]
            },
            "description": "What the account needs to look at now (alerts, most serious first), the four first steps, and the numbers by connection state. Everything is decided by the API, so a home screen has nothing to calculate.\n\nRequired scope: numbers:read"
          },
          "response": []
        }
      ]
    },
    {
      "name": "Status",
      "description": "Availability probes and the state of the platform. No authentication.",
      "item": [
        {
          "name": "Check whether the API is up",
          "request": {
            "method": "GET",
            "auth": {
              "type": "noauth"
            },
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/healthz",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "healthz"
              ]
            },
            "description": "Answers 200 while the process is running. It requires no authentication and touches neither database nor queue, because it probes the process and not its dependencies. A 200 here does not promise that message sending works.\n\nPublic route: takes no key."
          },
          "response": []
        },
        {
          "name": "See whether Luna is receiving and delivering",
          "request": {
            "method": "GET",
            "auth": {
              "type": "noauth"
            },
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/status",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "status"
              ]
            },
            "description": "Answers 200 with the platform state, measured every few minutes by a synthetic message that enters through the same door Meta uses and has to reach a destination over HTTPS. It requires no authentication and reveals no account data. When there is no recent check yet, the state is unknown, never ok.\n\nPublic route: takes no key."
          },
          "response": []
        },
        {
          "name": "Introduce the API",
          "request": {
            "method": "GET",
            "auth": {
              "type": "noauth"
            },
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/",
              "host": [
                "{{baseUrl}}"
              ],
              "path": []
            },
            "description": "Answers 200 with the API name and the addresses of the documentation and of the OpenAPI specification. It requires no authentication and touches neither database nor queue.\n\nPublic route: takes no key."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Console and public pages",
      "description": "Routes the Luna console and the public connection link page use: sign-up, login, session and completion of the flow. You normally do not need them. They exist here because the console is a client of this same API, with no privileged route.",
      "item": [
        {
          "name": "Read the connect link (customer page)",
          "request": {
            "method": "GET",
            "auth": {
              "type": "noauth"
            },
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/public/onboarding-links/:token",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "public",
                "onboarding-links",
                ":token"
              ],
              "variable": [
                {
                  "key": "token",
                  "value": "YOUR_TOKEN"
                }
              ]
            },
            "description": "For the page your customer opens. Returns the name of the account that asked for the connection, the link status, and the public identifiers of the Meta app that the connection window uses. Nothing else about your account comes out here.\n\nPublic route: takes no key."
          },
          "response": []
        },
        {
          "name": "Open the connection session through the link",
          "request": {
            "method": "POST",
            "auth": {
              "type": "noauth"
            },
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/public/onboarding-links/:token/sessions",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "public",
                "onboarding-links",
                ":token",
                "sessions"
              ],
              "variable": [
                {
                  "key": "token",
                  "value": "YOUR_TOKEN"
                }
              ]
            },
            "description": "Opens the session that Meta's window fills in, for the account that owns the link. It is the same opening as POST /v1/onboarding/sessions, through the token's door. On a reconnection link (created with numberId), the session is born bound to the number's account, as in POST /v1/onboarding/reconnect.\n\nPublic route: takes no key."
          },
          "response": []
        },
        {
          "name": "Complete the connection through the link",
          "request": {
            "method": "POST",
            "auth": {
              "type": "noauth"
            },
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/public/onboarding-links/:token/sessions/:sessionId/complete",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "public",
                "onboarding-links",
                ":token",
                "sessions",
                ":sessionId",
                "complete"
              ],
              "variable": [
                {
                  "key": "token",
                  "value": "YOUR_TOKEN"
                },
                {
                  "key": "sessionId",
                  "value": "YOUR_SESSIONID"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"code\": \"YOUR_CODE\",\n  \"csrfState\": \"YOUR_CSRFSTATE\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Exchanges the code from Meta's window for access to the customer's account. It is the same completion as POST /v1/onboarding/sessions/{id}/complete, through the token's door, and the same warning holds: the code lasts 30 seconds, so call it the moment it arrives.\n\nPublic route: takes no key."
          },
          "response": []
        },
        {
          "name": "Report an abandoned or failed flow through the link",
          "request": {
            "method": "POST",
            "auth": {
              "type": "noauth"
            },
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/public/onboarding-links/:token/sessions/:sessionId/abandon",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "public",
                "onboarding-links",
                ":token",
                "sessions",
                ":sessionId",
                "abandon"
              ],
              "variable": [
                {
                  "key": "token",
                  "value": "YOUR_TOKEN"
                },
                {
                  "key": "sessionId",
                  "value": "YOUR_SESSIONID"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"csrfState\": \"YOUR_CSRFSTATE\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Telemetry about what happened in Meta's window when the customer did not complete. It is the same report as POST /v1/onboarding/sessions/{id}/abandon, through the token's door, and it only applies to a session opened by this same link.\n\nPublic route: takes no key."
          },
          "response": []
        },
        {
          "name": "Create an account",
          "request": {
            "method": "POST",
            "auth": {
              "type": "noauth"
            },
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/operators/signup",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "operators",
                "signup"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"ana@suaempresa.com.br\",\n  \"password\": \"YOUR_PASSWORD\",\n  \"tenantName\": \"YOUR_TENANTNAME\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Creates the account and its first operator, in a single call and with no credential.\n\nPublic route: takes no key."
          },
          "response": []
        },
        {
          "name": "Confirm an account's email",
          "request": {
            "method": "GET",
            "auth": {
              "type": "noauth"
            },
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/operators/confirm",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "operators",
                "confirm"
              ]
            },
            "description": "Destination of the link sent by email when the account is created. It answers with a redirect to the console, and not with JSON, because a person in a browser is what opens it.\n\nPublic route: takes no key."
          },
          "response": []
        },
        {
          "name": "Ask for a password reset",
          "request": {
            "method": "POST",
            "auth": {
              "type": "noauth"
            },
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/operators/password/forgot",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "operators",
                "password",
                "forgot"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"ana@suaempresa.com.br\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Asks for a link to choose a new password. It takes only the account email.\n\nPublic route: takes no key."
          },
          "response": []
        },
        {
          "name": "Choose a new password",
          "request": {
            "method": "POST",
            "auth": {
              "type": "noauth"
            },
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/operators/password/reset",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "operators",
                "password",
                "reset"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"token\": \"YOUR_TOKEN\",\n  \"password\": \"YOUR_PASSWORD\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Changes the operator's password from the token in the link sent by email, and answers 204.\n\nPublic route: takes no key."
          },
          "response": []
        },
        {
          "name": "Check the reset link",
          "request": {
            "method": "POST",
            "auth": {
              "type": "noauth"
            },
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/operators/password/reset/check",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "operators",
                "password",
                "reset",
                "check"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"token\": \"YOUR_TOKEN\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Answers 204 when the link token is still valid and 400 when it is not, without consuming it. Lets the screen warn before the person types the new password.\n\nPublic route: takes no key."
          },
          "response": []
        },
        {
          "name": "Read the password rule",
          "request": {
            "method": "GET",
            "auth": {
              "type": "noauth"
            },
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/public/password-policy",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "public",
                "password-policy"
              ]
            },
            "description": "The minimum length of an operator password, the same at signup, reset and change. It asks for no credential.\n\nPublic route: takes no key."
          },
          "response": []
        },
        {
          "name": "Change the password",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/operators/password/change",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "operators",
                "password",
                "change"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"currentPassword\": \"YOUR_CURRENTPASSWORD\",\n  \"newPassword\": \"YOUR_NEWPASSWORD\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Changes the password of the operator behind the presented session, checking the current password, and answers 204. The operator's other sessions are ended and the presented one stays valid. A wrong current password, or a credential with no operator (an integration key), answers 401.\n\nRequired scope: session:elevate"
          },
          "response": []
        },
        {
          "name": "Resend the confirmation email",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/operators/confirmation/resend",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "operators",
                "confirmation",
                "resend"
              ]
            },
            "description": "Sends the confirmation link again to the email of the operator behind the session, and invalidates the previous link if it had not been opened. The new link is valid for seven days and is accepted a single time.\n\nRequired scope: session:end"
          },
          "response": []
        },
        {
          "name": "Authenticate an operator",
          "request": {
            "method": "POST",
            "auth": {
              "type": "noauth"
            },
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/operators/login",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "operators",
                "login"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"ana@suaempresa.com.br\",\n  \"password\": \"YOUR_PASSWORD\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Exchanges email and password for an eight hour session credential, used by the web console.\n\nPublic route: takes no key."
          },
          "response": []
        },
        {
          "name": "Re-authenticate for a sensitive action",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/operators/step-up",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "operators",
                "step-up"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"password\": \"YOUR_PASSWORD\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Confirms the password of the operator behind the session presented, and opens a two hour window in which that same session can create and revoke API keys.\n\nRequired scope: session:elevate"
          },
          "response": []
        },
        {
          "name": "Read the presented session",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/operators/session",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "operators",
                "session"
              ]
            },
            "description": "When the presented credential expires, until when the elevation opened by POST /v1/operators/step-up lasts (null with no elevation or with the window closed) and the scopes it has now. It reads only the credential itself: the identifier comes from authentication and never from the path.\n\nRequired scope: session:end"
          },
          "response": []
        },
        {
          "name": "End the session",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/operators/logout",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "operators",
                "logout"
              ]
            },
            "description": "Revokes the credential presented, and only it. The identifier comes from the authentication itself and never from the body, so this route cannot revoke someone else's key.\n\nRequired scope: session:end"
          },
          "response": []
        }
      ]
    }
  ]
}
