Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Muhammadbugaje/NAMETS_Website/llms.txt

Use this file to discover all available pages before exploring further.

All NAMETS REST API endpoints are protected by the N8NAuthentication scheme. Every request must include a valid X-N8N-Token header, whose value must match the N8N_API_TOKEN environment variable configured on the server. Requests that omit the header or supply an incorrect token are rejected immediately — no request body or query parameters are processed.

How the token is validated

The server-side authentication class reads the X-N8N-Token header from each incoming request and performs a direct string comparison against settings.N8N_API_TOKEN. If the token is missing or does not match, a 403 Forbidden response is returned before any view logic executes.
class N8NAuthentication(BaseAuthentication):
    def authenticate(self, request):
        token = request.headers.get('X-N8N-Token')
        if not token or token != settings.N8N_API_TOKEN:
            raise AuthenticationFailed('Invalid or missing token')
        return (None, None)  # No user, just authenticated
The return (None, None) means authentication succeeds without attaching a Django user object to the request. The API authenticates the caller (your integration or automation tool) rather than an individual user account.

Sending the header

Include X-N8N-Token in every API call:
curl -H "X-N8N-Token: your_api_token" https://your-site.onrender.com/api/subscribers/
Replace your_api_token with the value of the N8N_API_TOKEN environment variable set on your server.

Setting the environment variable

On your server (e.g., Render), add the following environment variable:
VariableDescription
N8N_API_TOKENThe shared secret token that authenticates API requests
All requests that omit the X-N8N-Token header or supply an incorrect value return 403 Forbidden. There is no grace period or fallback authentication method.

Generating a secure token

Use Python’s secrets module to generate a cryptographically strong token:
Run the following command to generate a secure 256-bit hex token suitable for production use:
python -c "import secrets; print(secrets.token_hex(32))"
Copy the output and set it as N8N_API_TOKEN in your server’s environment. Store it in a secrets manager — never commit it to version control.

Build docs developers (and LLMs) love