Skip to main content

Authentication

Getting started. Most API requests require a Bearer token in the Authorization header. This page explains how to obtain and use tokens.

Getting Your API Key

To obtain your API key:

  1. Log in to the dashboard (or your dashboard URL)
  2. Navigate to "My Account" > "API Tokens" section
  3. Generate and copy your API key

Using Your API Key

Once you have your API key, include it in all API requests using the standard Authorization header with the Bearer scheme:

Authorization: Bearer your-api-key-here

Example Request

curl -X GET https://v1.freeqr.io/api/user \
-H "Authorization: Bearer your-api-key-here" \
-H "Content-Type: application/json"

Example with JavaScript (fetch)

fetch('https://v1.freeqr.io/api/user', {
method: 'GET',
headers: {
'Authorization': 'Bearer your-api-key-here',
'Content-Type': 'application/json'
}
})

Example with Python (requests)

import requests

headers = {
'Authorization': 'Bearer your-api-key-here',
'Content-Type': 'application/json'
}

response = requests.get('https://v1.freeqr.io/api/user', headers=headers)

Security Best Practices

  • Keep your API key secure: Never commit API keys to version control or expose them in client-side code
  • Rotate keys regularly: If you suspect your key has been compromised, generate a new one from the dashboard
  • Use environment variables: Store your API key in environment variables rather than hardcoding it
  • Restrict permissions: Use API keys with the minimum required permissions for your use case

Authentication Errors

If your API key is missing, invalid, or expired, you will receive a 401 Unauthorized response:

{
"message": "Unauthorized."
}

Make sure your API key is correctly included in the Authorization header with the Bearer prefix.