Skip to main content

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"
}
FieldTypeRequiredDescription
emailstringYesMust be unique system-wide
namestringYesClient's full name
companystringNoClient's company

Response: 201 Created

{
"id": 17,
"email": "newclient@example.com",
"name": "New Client",
"company": "Client Corp",
"license_count": 0
}

Errors:

CodeReason
400Email already exists in the system
403Not 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:

  1. Create client + licenses via API
  2. Receive license.activated webhook when client activates on their domain
  3. Update your internal systems accordingly