Client API
API reference for sub-client management. All endpoints require Reseller or Agency role.
Base path: /api/v1/portal/clients
List Clients
GET /api/v1/portal/clients
Auth: JWT or API Key
Returns all your sub-clients.
Response:
[
{
"id": 15,
"email": "client@example.com",
"name": "John Doe",
"company": "Doe Industries",
"license_count": 4
},
{
"id": 16,
"email": "jane@example.com",
"name": "Jane Smith",
"company": null,
"license_count": 2
}
]
Create Client
POST /api/v1/portal/clients
Auth: JWT or API Key
Request Body:
{
"email": "newclient@example.com",
"name": "New Client",
"company": "Client Corp"
}
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Must be unique system-wide |
name | string | Yes | Client's full name |
company | string | No | Client's company |
Response: 201 Created
{
"id": 17,
"email": "newclient@example.com",
"name": "New Client",
"company": "Client Corp",
"license_count": 0
}
Errors:
| Code | Reason |
|---|---|
400 | Email already exists in the system |
403 | Not a Reseller or Agency account |
Delete Client
DELETE /api/v1/portal/clients/{client_id}
Auth: JWT or API Key
Deletes the sub-client and revokes all their licenses.
Response: 204 No Content
caution
This is irreversible. All client licenses are revoked and deactivated on all domains.
Get Client Licenses
GET /api/v1/portal/clients/{client_id}/licenses
Auth: JWT or API Key
Returns all licenses assigned to a specific sub-client.
Response:
[
{
"id": 42,
"license_key": "FLVR-ABCD-...",
"product": {
"id": 1,
"name": "Flavor Starter Theme",
"slug": "flavor-starter"
},
"tier": "starter",
"status": "active",
"expires_at": "2027-03-30T00:00:00Z",
"activations": [
{
"domain": "client-site.com",
"activated_at": "2026-04-01T10:00:00Z"
}
]
}
]
Typical Workflow
A typical client management workflow:
# 1. Create a sub-client
curl -X POST https://admin.flavorteam.dev/api/v1/portal/clients \
-H "X-API-Key: fh_live_..." \
-H "Content-Type: application/json" \
-d '{"email": "client@example.com", "name": "My Client"}'
# 2. Create licenses for the client
curl -X POST https://admin.flavorteam.dev/api/v1/portal/licenses \
-H "X-API-Key: fh_live_..." \
-H "Content-Type: application/json" \
-d '{"product_id": 1, "tier": "starter", "customer_id": 17}'
curl -X POST https://admin.flavorteam.dev/api/v1/portal/licenses \
-H "X-API-Key: fh_live_..." \
-H "Content-Type: application/json" \
-d '{"product_id": 2, "tier": "starter", "customer_id": 17}'
# 3. Check client's licenses
curl https://admin.flavorteam.dev/api/v1/portal/clients/17/licenses \
-H "X-API-Key: fh_live_..."
# 4. Client activates licenses on their WordPress site (automatic via WP admin)
Automation
Combine the Client API with Webhooks to build fully automated license provisioning:
- Create client + licenses via API
- Receive
license.activatedwebhook when client activates on their domain - Update your internal systems accordingly