Skip to main content
CRM & Sales

Customer Services

List available services, view customer assignments, and sync service sets for individual customers.

Auth required: Yes (auth:api) for all endpoints.

Customer services are service subscriptions linked to customers. They represent optional features or service tiers (e.g. support contracts, specific platform access, etc.).


Model Properties

Customer Service (Catalog)

Property Type Required Description
id integer auto Unique identifier
key string Yes Unique machine-readable key (e.g. support_premium). Used for feature flag checks
name string Yes Human-readable service name
description string No Description of what this service provides
can_be_enabled boolean No Whether customers can self-enable this service (default: false)
created_at datetime auto Creation timestamp
updated_at datetime auto Last update timestamp

Customer-Service Assignment (pivot table for POST /v1/customers/{customer}/services):

The assignment uses a many-to-many pivot table. The POST endpoint syncs the entire set of services: any services not included in the services array will be removed.


Customer Service Catalog

Base URL: /api/v1/customer-services

These endpoints manage the catalog of available services.

GET /v1/customer-services

List all customer services with filtering, sorting, and pagination.

Query parameters:

Parameter Type Description
filter[name] string Filter by name
filter[key] string Filter by key
sort string Sort field (id, name, key, created_at, updated_at)

Response 200: Paginated list (10 per page) of customer service objects with the count of associated customers.

Examples:

curl -X GET "https://your-instance.bluerocktel.net/api/v1/customer-services?filter[name]=support&sort=name" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"
import requests

response = requests.get(
    "https://your-instance.bluerocktel.net/api/v1/customer-services",
    params={"filter[name]": "support", "sort": "name"},
    headers={"Authorization": "Bearer YOUR_API_TOKEN"}
)
services = response.json()
$response = Http::withToken('YOUR_API_TOKEN')
    ->get('https://your-instance.bluerocktel.net/api/v1/customer-services', [
        'filter[name]' => 'support',
        'sort' => 'name',
    ]);

$services = $response->json();
const response = await fetch(
  "https://your-instance.bluerocktel.net/api/v1/customer-services?filter[name]=support&sort=name",
  {
    headers: {
      "Authorization": "Bearer YOUR_API_TOKEN",
      "Accept": "application/json"
    }
  }
);
const services = await response.json();

GET /v1/customer-services/{id}

Get a single customer service by ID.

URL parameters:

Parameter Type Description
id integer Customer service ID

Response 200: Customer service object with associated customers (id, name, customer_account only). Response 404: Not found.


Customer-Specific Services

Base URL: /api/v1/customers/{customer}/services

These endpoints manage which services are assigned to a specific customer.

GET /v1/customers/{customer}/services

List services assigned to a customer.

URL parameters:

Parameter Type Description
customer integer Customer ID (route model binding)

Query parameters:

Parameter Type Description
filter[name] string Filter by name
filter[key] string Filter by key
sort string Sort field (id, name, key, created_at, updated_at)

Response 200: Paginated list (10 per page) of services assigned to the customer.

Examples:

curl -X GET "https://your-instance.bluerocktel.net/api/v1/customers/42/services" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"
import requests

response = requests.get(
    "https://your-instance.bluerocktel.net/api/v1/customers/42/services",
    headers={"Authorization": "Bearer YOUR_API_TOKEN"}
)
customer_services = response.json()
$response = Http::withToken('YOUR_API_TOKEN')
    ->get('https://your-instance.bluerocktel.net/api/v1/customers/42/services');

$customerServices = $response->json();
const response = await fetch(
  "https://your-instance.bluerocktel.net/api/v1/customers/42/services",
  {
    headers: {
      "Authorization": "Bearer YOUR_API_TOKEN",
      "Accept": "application/json"
    }
  }
);
const customerServices = await response.json();

POST /v1/customers/{customer}/services

Sync the full set of services for a customer. This replaces all existing service assignments.

URL parameters:

Parameter Type Description
customer integer Customer ID (route model binding)

Body (JSON):

Field Type Required Description
services array Yes Array of service IDs to assign

Response 201: Success message.

Examples:

curl -X POST "https://your-instance.bluerocktel.net/api/v1/customers/42/services" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"services": [1, 3, 7]}'
import requests

response = requests.post(
    "https://your-instance.bluerocktel.net/api/v1/customers/42/services",
    json={"services": [1, 3, 7]},
    headers={"Authorization": "Bearer YOUR_API_TOKEN"}
)
result = response.json()
$response = Http::withToken('YOUR_API_TOKEN')
    ->post('https://your-instance.bluerocktel.net/api/v1/customers/42/services', [
        'services' => [1, 3, 7],
    ]);

$result = $response->json();
const response = await fetch(
  "https://your-instance.bluerocktel.net/api/v1/customers/42/services",
  {
    method: "POST",
    headers: {
      "Authorization": "Bearer YOUR_API_TOKEN",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({ services: [1, 3, 7] })
  }
);
const result = await response.json();