Skip to main content
Hadiq.io uses API keys for authentication. Each key is associated with a role that determines what actions it can perform.

Create an API key

1

Open the Admin panel

Log in to Hadiq.io and navigate to Admin in the left sidebar.
2

Go to API Keys

Select API Keys from the admin menu.
3

Create a new key

Click New API Key. Give the key a name (optional) and select a role:Click Create.
4

Copy the key

The full API key is shown only once immediately after creation. Copy it and store it securely. Hadiq.io only stores a hashed representation and cannot show you the key again.The key is prefixed with hadiqk-.
Treat your API key like a password. Do not commit it to source control or share it in plaintext. If a key is compromised, delete it and create a new one.

Use the key in requests

Pass the key in the Authorization header of every request:

Manage existing keys

List all API keys

Requires admin role. Returns an array of ApiKeyDescriptor objects.
integer
Unique identifier for the key.
string
Masked version of the key safe to display in a UI (e.g. onyxk-abc...xyz).
string
The full key value. Only present in the response immediately after creation or regeneration.
string
Human-readable label you assigned to the key.
string
Role assigned to the key: basic or admin.
string (UUID)
Internal user ID associated with the key.

Regenerate a key

Issues a new key value for the given key ID. The old value is immediately invalidated. Returns the same ApiKeyDescriptor shape with the new api_key included.

Update a key’s name or role

Request body:
string
New human-readable name for the key.
string
New role: basic or admin.

Delete a key

Returns 204 No Content. The key is revoked immediately.

Error codes