{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-products/whatsapp/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"type":"markdown"},"seo":{"title":"Authentication","description":"Integration and usage documentation."},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"authentication","__idx":0},"children":["Authentication"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["All API requests to the WhatsApp Gateway must be authenticated using ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["both"]}," Basic Auth credentials and an API key provided by Namirial support."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"how-to-authenticate","__idx":1},"children":["How to authenticate"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"basic-auth","__idx":2},"children":["Basic Auth"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Include your credentials in every request using HTTP Basic Authentication:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"Authorization: Basic <base64(username:password)>\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"api-key","__idx":3},"children":["API key"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Include your API key in every request using the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["X-Api-Key"]}," header:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"X-Api-Key: <your-api-key>\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-curl","__idx":4},"children":["Example (curl)"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST \"https://wa.namirialtsp.com/api/services/send\" \\\n  -H \"Authorization: Basic <base64(username:password)>\" \\\n  -H \"X-Api-Key: <your-api-key>\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{ ... }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"troubleshooting-authentication-issues","__idx":5},"children":["Troubleshooting authentication issues"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"HTTP Status"},"children":["HTTP Status"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Error code"},"children":["Error code"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Error type"},"children":["Error type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Solution"},"children":["Solution"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["401"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["1"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AuthenticationFailedException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Verify your Basic Auth credentials for the target environment"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["401"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["9"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["MissingApiKeyException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["X-Api-Key"]}," header is missing. Add it to your request"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["401"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["9"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["InvalidApiKeyException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["X-Api-Key"]}," value is not valid. Verify the key for the target environment"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["403"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["6"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ForbiddenException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Your account does not have the required permissions. Contact Namirial support"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Example — invalid credentials (code 1):"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"type\": \"AuthenticationFailedException\",\n  \"code\": 1,\n  \"message\": \"Invalid credentials\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Example — insufficient role (code 6):"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"type\": \"ForbiddenException\",\n  \"code\": 6,\n  \"message\": \"Current role [USER], missing role [ADMIN, TEMPLATE_ADMIN]\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["HTTP 403 is returned when the account is authenticated but does not have the required role."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Example — missing API key (code 9):"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"type\": \"MissingApiKeyException\",\n  \"code\": 9,\n  \"message\": \"Missing API key\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Example — invalid API key (code 9):"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"type\": \"InvalidApiKeyException\",\n  \"code\": 9,\n  \"message\": \"Invalid API Key\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"how-to-get-api-credentials","__idx":6},"children":["How to get API credentials"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Submit a request through the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://support.namirial.com"},"children":["Namirial support portal"]},"."]}]},"headings":[{"value":"Authentication","id":"authentication","depth":1},{"value":"How to authenticate","id":"how-to-authenticate","depth":2},{"value":"Basic Auth","id":"basic-auth","depth":3},{"value":"API key","id":"api-key","depth":3},{"value":"Example (curl)","id":"example-curl","depth":3},{"value":"Troubleshooting authentication issues","id":"troubleshooting-authentication-issues","depth":2},{"value":"How to get API credentials","id":"how-to-get-api-credentials","depth":2}],"frontmatter":{"seo":{"title":"Authentication"}},"lastModified":"2026-03-12T17:07:43.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/whatsapp/enterprise-documentation/developer-documentation/authentication","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}