Adonis API Documentation

Welcome to the Adonis developer platform. Use the REST API to build integrations, automate workflows, and extend your workspace programmatically.

Base URL: https://yourdomain.com/api/v1/

Overview

All API responses are JSON. All requests must include an Accept: application/json header. The API supports two authentication methods: JWT tokens (for user sessions) and API keys (for programmatic access).

Authentication

JWT Authentication (User Sessions)

Obtain a token via POST /v1/auth/login and include it in every request:

Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…

API Key Authentication

Generate API keys from your Developer Dashboard. Keys follow the format adw_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:

Authorization: Bearer adw_live_a1b2c3d4e5f6…
API keys are hashed on the server. The raw key is shown only once on creation — copy it immediately. API keys respect the scopes assigned at creation time. JWT tokens have full access to user-owned resources.

Example Request

curl -X GET https://yourdomain.com/api/v1/licenses \
  -H "Authorization: Bearer adw_live_…" \
  -H "Accept: application/json"

Rate Limiting

Auth typeLimitWindow
API Key120 requests60 seconds per key
JWT300 requests60 seconds per user
Public (unauthenticated)30 requests60 seconds per IP

When exceeded, the API returns 429 Too Many Requests with a Retry-After header.

Error Responses

{
  "success": false,
  "error": {
    "code": "VALIDATION_FAILED",
    "message": "The name field is required."
  }
}
HTTP StatusCodeMeaning
400VALIDATION_FAILEDRequest payload failed validation
401UNAUTHORIZEDMissing or invalid authentication
403FORBIDDENAuthenticated but lacks permission
404NOT_FOUNDResource not found
422VALIDATION_FAILEDSemantic validation error
429RATE_LIMIT_EXCEEDEDToo many requests
500INTERNAL_SERVER_ERRORServer error

API Key Scopes

When creating an API key, select only the scopes your integration needs. JWT tokens bypass scope checks.

read:licenses write:licenses read:tickets write:tickets read:billing write:billing read:users write:users read:analytics read:notifications manage:webhooks manage:apikeys

API Key Endpoints

GET
/v1/developer/keys
List your API keys (names, prefixes, last used)
POST
/v1/developer/keys
Create a new API key — raw key returned once only
POST /v1/developer/keys
{
  "name": "CI/CD Pipeline",
  "scopes": ["read:licenses", "read:analytics"],
  "expires_at": "2025-12-31"   // optional
}
DELETE
/v1/developer/keys/{id}
Revoke an API key immediately

Licenses

Required scope: read:licenses / write:licenses

GET
/v1/licenses
List all licenses for the authenticated user
GET
/v1/licenses/{id}
Get a single license by ID
POST
/v1/licenses/{id}/activate
Activate a license on a new domain/machine
POST
/v1/licenses/validate
Validate a license key (public, no auth required)

Subscriptions

Required scope: read:billing / write:billing

GET
/v1/plans
List available subscription plans
GET
/v1/subscription
Get current subscription for the active organization
POST
/v1/subscription/create
Start a new subscription
POST
/v1/subscription/upgrade
Upgrade or downgrade to a different plan
POST
/v1/subscription/cancel
Cancel the active subscription

Billing

Required scope: read:billing

GET
/v1/subscription/invoices
List subscription invoices
GET
/v1/billing/invoices
List all invoices (purchases + subscriptions)
GET
/v1/wallet
Get wallet balance and details

Support Tickets

Required scope: read:tickets / write:tickets

GET
/v1/tickets
List support tickets (own tickets only)
POST
/v1/tickets
Create a new support ticket
GET
/v1/tickets/{id}
Get ticket details and replies
POST
/v1/tickets/{id}/reply
Add a reply to a ticket

Notifications

Required scope: read:notifications

GET
/v1/notifications
List recent notifications (own only)
GET
/v1/notifications/unread-count
Get unread notification count
PUT
/v1/notifications/{id}/read
Mark a notification as read

Webhooks

Webhooks let Adonis notify your server in real-time when events occur. Adonis sends a POST request to your configured endpoint with a JSON payload.

Required scope: manage:webhooks

GET
/v1/developer/webhooks
List webhooks
POST
/v1/developer/webhooks
Register a new webhook endpoint
PUT
/v1/developer/webhooks/{id}
Update webhook URL, events, or active status
DELETE
/v1/developer/webhooks/{id}
Delete a webhook
GET
/v1/developer/webhooks/{id}/deliveries
View recent delivery attempts

Webhook Payload

{
  "event": "subscription.renewed",
  "timestamp": "2024-01-15T10:30:00+00:00",
  "data": {
    "subscription_id": 42,
    "plan_name": "Business",
    "user_id": 7,
    "renewed_at": "2024-01-15T10:30:00Z"
  }
}

Webhook Events Reference

EventTriggered when
subscription.createdA new subscription is started
subscription.renewedSubscription is successfully renewed
subscription.cancelledSubscription is cancelled
subscription.expiredSubscription expires without renewal
license.activatedA license key is activated on a new site
license.deactivatedA license activation is removed
license.revokedA license is revoked by an admin
payment.receivedA payment is approved
payment.failedA payment fails or is rejected
user.createdNew user account registered
kyc.approvedKYC verification is approved
kyc.rejectedKYC verification is rejected
ticket.createdA new support ticket is opened
ticket.repliedA reply is added to a ticket
ticket.closedA ticket is closed

Signature Verification

Every webhook request includes an X-Adonis-Signature header. Verify it to confirm requests originate from Adonis:

// PHP
function verifyWebhook(string $payload, string $secret, string $header): bool {
    if (strpos($header, 'sha256=') !== 0) return false;
    $expected = 'sha256=' . hash_hmac('sha256', $payload, $secret);
    return hash_equals($expected, $header);
}

$payload   = file_get_contents('php://input');
$signature = $_SERVER['HTTP_X_ADONIS_SIGNATURE'] ?? '';
if (!verifyWebhook($payload, 'wh_your_secret', $signature)) {
    http_response_code(401);
    exit;
}
// Node.js
const crypto = require('crypto');
function verifyWebhook(payload, secret, header) {
    const expected = 'sha256=' + crypto
        .createHmac('sha256', secret)
        .update(payload)
        .digest('hex');
    return crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(header));
}
Always use a constant-time comparison (hash_equals / timingSafeEqual). Never use === to compare signatures — it is vulnerable to timing attacks.

Service Accounts

Service accounts are named identities for automated processes within your organization. They can be assigned specific scopes and used to generate dedicated API keys.

GET
/v1/developer/service-accounts
List service accounts
POST
/v1/developer/service-accounts
Create a new service account
DELETE
/v1/developer/service-accounts/{id}
Delete a service account

Changelog

v1.3 — Developer Platform

v1.2 — Organizations & Subscriptions

v1.1 — Core Platform

Questions? Open a support ticket or visit your developer dashboard.