Skip to content
Dashboard

Start here

View as Markdown

Getting started

Create an API key and make your first request to the Diamwall public API.

>_API

This page takes you from zero to a working request.

API keys are created in the Diamwall dashboard, not through the API.

  1. Open the API keys page in the dashboard and choose to create a key.
  2. 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.
  3. Confirm with your authenticator code if your account uses two-factor authentication, or with your password otherwise.
  4. Copy the key.

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"

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.

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.