Overview
Clients are global entities in the agency system. They represent organizations or brands for which you manage links and campaigns. All authenticated users can access client endpoints.
All endpoints require authentication via Bearer token in the Authorization header.
List Clients
Response
Unique identifier (UUID) of the client.
Number of campaigns associated with this client.
Number of links associated with this client.
ISO 8601 timestamp of creation.
Example Request
curl -X GET https://api.example.com/clients \
-H "Authorization: Bearer YOUR_TOKEN"
Example Response
[
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Acme Corp",
"campaignsCount": 5,
"linksCount": 127,
"createdAt": "2026-01-15T08:00:00.000Z"
},
{
"id": "234e5678-e89b-12d3-a456-426614174111",
"name": "Tech Startup Inc",
"campaignsCount": 3,
"linksCount": 64,
"createdAt": "2026-02-01T10:30:00.000Z"
}
]
Create Client
Request Body
Name of the client. Must be at least 3 characters long and unique.
Response
Unique identifier (UUID) of the created client.
ISO 8601 timestamp of creation.
ISO 8601 timestamp of last update.
Example Request
curl -X POST https://api.example.com/clients \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "New Client Inc"
}'
Example Response
{
"id": "345e6789-e89b-12d3-a456-426614174222",
"name": "New Client Inc",
"createdAt": "2026-03-09T10:30:00.000Z",
"updatedAt": "2026-03-09T10:30:00.000Z"
}
Error Responses
Client with this name already exists.{
"message": "Client already exists"
}
Get Client
Path Parameters
UUID of the client to retrieve.
Response
Unique identifier (UUID) of the client.
ISO 8601 timestamp of creation.
ISO 8601 timestamp of last update.
Example Request
curl -X GET https://api.example.com/clients/123e4567-e89b-12d3-a456-426614174000 \
-H "Authorization: Bearer YOUR_TOKEN"
Example Response
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Acme Corp",
"createdAt": "2026-01-15T08:00:00.000Z",
"updatedAt": "2026-01-15T08:00:00.000Z"
}
Error Responses
Client not found.{
"message": "Client not found"
}
Update Client
Path Parameters
UUID of the client to update.
Request Body
Updated name for the client. Must be at least 3 characters long and unique.
Response
Returns the updated client object with the same structure as the Get Client response.
Example Request
curl -X PUT https://api.example.com/clients/123e4567-e89b-12d3-a456-426614174000 \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Acme Corporation"
}'
Example Response
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Acme Corporation",
"createdAt": "2026-01-15T08:00:00.000Z",
"updatedAt": "2026-03-09T10:30:00.000Z"
}
Error Responses
Client not found.{
"message": "Client not found"
}
Another client with this name already exists.{
"message": "Client already exists"
}
Delete Client
Path Parameters
UUID of the client to delete.
Response
Returns 204 No Content on success.
Example Request
curl -X DELETE https://api.example.com/clients/123e4567-e89b-12d3-a456-426614174000 \
-H "Authorization: Bearer YOUR_TOKEN"
Error Responses
Client not found.{
"message": "Client not found"
}
This operation is irreversible. Deleting a client will also permanently delete:
- All campaigns associated with the client
- All links associated with the client
- All click analytics for those links