Authentication
Learn how to authenticate your requests with the Sakneen API.
API Key Authentication
Sakneen API uses API key authentication for protected operations. Include your key in the api-key request header. The public health check requires no key and does not validate your credentials.
Getting Your API Key
- Contact Sakneen support team
- Provide your company details and use case
- Receive your unique API key and assigned domain
Using Your API Key
Include the API key in your request headers:
curl -X POST "https://your-domain/external/apis/v1.0/leads" \
-H "api-key: your-api-key-here" \
-H "Content-Type: application/json"Note: Replace your-domain with the actual domain provided by Sakneen support.
You can also use the interactive API reference. Enter the assigned HTTPS origin, confirm the exact destination, and then enter your key in the masked field. The key stays in page memory, is cleared when the host or environment changes, and is excluded from examples and downloads. Start with the public connection check, then a protected GET. Choose an approved sandbox before sending writes.
Security Best Practices
- Never embed your API key in application client-side code. The documentation playground accepts it temporarily for requests you explicitly send.
- Store API keys securely using environment variables
- Rotate your API keys regularly
- Use HTTPS in production environments
Example Implementation
JavaScript/Node.js
const apiKey = process.env.SAKNEEN_API_KEY;
const baseDomain = process.env.SAKNEEN_DOMAIN; // e.g., "your-domain"
const response = await fetch(`https://${baseDomain}/external/apis/v1.0/leads`, {
method: "POST",
headers: {
"api-key": apiKey,
"Content-Type": "application/json",
language: "en-us",
},
body: JSON.stringify({
recordSystemId: "website-form-uuid-001",
data: {
name: "John Doe",
phoneNumber: "+1234567890",
project: "Downtown Tower",
email: "[email protected]",
leadSource: "Website",
},
additionalData: {
landingPage: "/campaigns/summer",
},
}),
});Python
import os
import requests
api_key = os.getenv('SAKNEEN_API_KEY')
base_domain = os.getenv('SAKNEEN_DOMAIN') # e.g., "your-domain"
headers = {
'api-key': api_key,
'Content-Type': 'application/json',
'language': 'en-us'
}
payload = {
'recordSystemId': 'website-form-uuid-001',
'data': {
'name': 'John Doe',
'phoneNumber': '+1234567890',
'project': 'Downtown Tower',
'email': '[email protected]',
'leadSource': 'Website'
},
'additionalData': {
'landingPage': '/campaigns/summer'
}
}
response = requests.post(
f'https://{base_domain}/external/apis/v1.0/leads',
json=payload,
headers=headers
)
print(response.json())