Start here
Getting started
Create an API key and make your first request to the Diamwall public API.
This page takes you from zero to a working request.
1. Create an API key
Section titled “1. Create an API key”API keys are created in the Diamwall dashboard, not through the API.
- Open the API keys page in the dashboard and choose to create a key.
- Give the key a name. Optionally set an expiry date, a list of allowed IPs and the domains the key may act on. See IP and domain restrictions.
- Confirm with your authenticator code if your account uses two-factor authentication, or with your password otherwise.
- Copy the key.
2. Make your first request
Section titled “2. Make your first request”Send the key in the Authorization header, with the Api-Key prefix:
curl https://api.diamwall.com/public-api/domains/ \ -H "Authorization: Api-Key $DIAMWALL_API_KEY"The answer is a paginated list of the domains this key can access.
To look up one domain, filter by its full name. The match ignores letter case:
curl "https://api.diamwall.com/public-api/domains/?name=example.com" \ -H "Authorization: Api-Key $DIAMWALL_API_KEY"3. Call the CDN endpoints
Section titled “3. Call the CDN endpoints”With a domain in hand you can call the CDN operations that accept an API key. The API reference lists every one of them, with parameters and response shapes.
If the request fails
Section titled “If the request fails”| What you see | Why | What to do |
|---|---|---|
403 API_KEY_INVALID |
The key is invalid or inactive. | Check the header is exactly Authorization: Api-Key <your-key> and that the key is still active. |
403 API_KEY_IP_NOT_ALLOWED |
The request comes from an IP outside the key’s list. | Call from an allowed IP, or update the key’s IP list in the dashboard. |
403 API_KEY_ACCESS_DENIED |
The key is not allowed to act on that domain. | Add the domain to the key in the dashboard. |
403 SECURITY_IP_NOT_ALLOWED |
The domain’s organization has its own IP list and your IP is not on it. | Call from an IP on the organization’s list. |
The full list is in Errors.