Managed Clients
Onboard and manage client organisations under your MSP
Managed Clients
Manage the client organisations that your MSP oversees. You can create new client organisations directly from your MSP account, list all managed clients, and remove clients from your MSP when necessary.
Clients created through the MSP API default to billingTo: "msp", meaning your MSP is charged for their consumption. This can be changed per client via the Configurations API.
Endpoints
| Method | Endpoint | Description | Min Role |
|---|---|---|---|
| GET | /api/msps/{mspId}/clients | List all managed clients | msp_reader |
| GET | /api/msps/{mspId}/clients/{clientId} | Get a specific managed client | msp_reader |
| POST | /api/msps/{mspId}/clients | Create a new client organisation | msp_admin |
| PUT | /api/msps/{mspId}/clients/{clientId} | Update a client organisation | msp_admin |
| DELETE | /api/msps/{mspId}/clients/{clientId} | Remove a client from your MSP | msp_admin |
List Managed Clients
Retrieve all client organisations managed by your MSP.
Request
GET /api/msps/{mspId}/clients HTTP/1.1
Host: api.requestrocket.com
Authorization: {user_token}Response
{
"clients": [
{
"clientId": "550e8400-e29b-41d4-a716-446655440000",
"clientName": "Acme Corporation",
"clientCreated": "2024-01-15T08:00:00.000Z",
"clientUpdated": "2024-02-10T14:30:00.000Z"
},
{
"clientId": "660e8400-e29b-41d4-a716-446655440001",
"clientName": "Globex Inc",
"clientCreated": "2024-02-01T09:00:00.000Z",
"clientUpdated": "2024-02-20T11:00:00.000Z"
}
],
"message": "Success"
}Example
curl -X GET "https://api.requestrocket.com/api/msps/${MSP_ID}/clients" \
-H "Authorization: ${USER_TOKEN}"const response = await fetch(
`https://api.requestrocket.com/api/msps/${mspId}/clients`,
{
headers: { 'Authorization': process.env.USER_TOKEN }
}
);
const data = await response.json();
console.log('Managed clients:', data.clients);import requests, os
response = requests.get(
f'https://api.requestrocket.com/api/msps/{msp_id}/clients',
headers={'Authorization': os.getenv('USER_TOKEN')}
)
for client in response.json()['clients']:
print(client['clientName'], client['clientId'])req, _ := http.NewRequest("GET",
fmt.Sprintf("https://api.requestrocket.com/api/msps/%s/clients", mspId), nil)
req.Header.Set("Authorization", os.Getenv("USER_TOKEN"))
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.requestrocket.com/api/msps/" + mspId + "/clients"))
.header("Authorization", System.getenv("USER_TOKEN"))
.GET()
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());Create Client
Create a new client organisation under your MSP. The client is immediately linked to your MSP, and a default configuration is provisioned with billingTo: "msp".
Request
POST /api/msps/{mspId}/clients HTTP/1.1
Host: api.requestrocket.com
Authorization: {user_token}
Content-Type: application/json
{
"clientName": "Acme Corporation"
}Request Body
| Field | Type | Required | Description |
|---|---|---|---|
clientName | string | Yes | Display name for the new client organisation |
Response
{
"client": {
"clientId": "550e8400-e29b-41d4-a716-446655440000",
"clientName": "Acme Corporation",
"clientCreated": "2024-03-01T10:00:00.000Z",
"clientUpdated": "2024-03-01T10:00:00.000Z"
},
"message": "Client created successfully"
}Example
curl -X POST "https://api.requestrocket.com/api/msps/${MSP_ID}/clients" \
-H "Authorization: ${USER_TOKEN}" \
-H "Content-Type: application/json" \
-d '{"clientName": "Acme Corporation"}'const response = await fetch(
`https://api.requestrocket.com/api/msps/${mspId}/clients`,
{
method: 'POST',
headers: {
'Authorization': process.env.USER_TOKEN,
'Content-Type': 'application/json'
},
body: JSON.stringify({ clientName: 'Acme Corporation' })
}
);
const data = await response.json();
console.log('New client ID:', data.client.clientId);import requests, os
response = requests.post(
f'https://api.requestrocket.com/api/msps/{msp_id}/clients',
headers={'Authorization': os.getenv('USER_TOKEN')},
json={'clientName': 'Acme Corporation'}
)
data = response.json()
print('New client ID:', data['client']['clientId'])body := bytes.NewBufferString(`{"clientName":"Acme Corporation"}`)
req, _ := http.NewRequest("POST",
fmt.Sprintf("https://api.requestrocket.com/api/msps/%s/clients", mspId), body)
req.Header.Set("Authorization", os.Getenv("USER_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
respBody, _ := io.ReadAll(resp.Body)
fmt.Println(string(respBody))String json = "{\"clientName\": \"Acme Corporation\"}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.requestrocket.com/api/msps/" + mspId + "/clients"))
.header("Authorization", System.getenv("USER_TOKEN"))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());Update Client
Update the name or other properties of a managed client organisation.
Request
PUT /api/msps/{mspId}/clients/{clientId} HTTP/1.1
Host: api.requestrocket.com
Authorization: {user_token}
Content-Type: application/json
{
"clientName": "Acme Corp (Renamed)"
}Request Body
| Field | Type | Required | Description |
|---|---|---|---|
clientName | string | No | New display name for the client |
Response
{
"client": {
"clientId": "550e8400-e29b-41d4-a716-446655440000",
"clientName": "Acme Corp (Renamed)",
"clientUpdated": "2024-03-05T14:00:00.000Z"
},
"message": "Client updated successfully"
}Delete Client
Remove a client organisation from your MSP. This unlinks the client from the MSP relationship.
Deleting a managed client removes the MSP–client relationship and deprovisions the client organisation. This action cannot be undone. Ensure the client's data and credentials are no longer needed before proceeding.
Request
DELETE /api/msps/{mspId}/clients/{clientId} HTTP/1.1
Host: api.requestrocket.com
Authorization: {user_token}Response
{
"message": "Client deleted successfully"
}Example
curl -X DELETE "https://api.requestrocket.com/api/msps/${MSP_ID}/clients/${CLIENT_ID}" \
-H "Authorization: ${USER_TOKEN}"const response = await fetch(
`https://api.requestrocket.com/api/msps/${mspId}/clients/${clientId}`,
{ method: 'DELETE', headers: { 'Authorization': process.env.USER_TOKEN } }
);
const data = await response.json();
console.log(data.message);import requests, os
response = requests.delete(
f'https://api.requestrocket.com/api/msps/{msp_id}/clients/{client_id}',
headers={'Authorization': os.getenv('USER_TOKEN')}
)
print(response.json()['message'])req, _ := http.NewRequest("DELETE",
fmt.Sprintf("https://api.requestrocket.com/api/msps/%s/clients/%s", mspId, clientId), nil)
req.Header.Set("Authorization", os.Getenv("USER_TOKEN"))
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.requestrocket.com/api/msps/" + mspId + "/clients/" + clientId))
.header("Authorization", System.getenv("USER_TOKEN"))
.DELETE()
.build();
HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());Managing Client Team Members
Once a client is created, you can manage their team members via the MSP path. This allows you to add, update, and remove members within a client organisation without needing to log in as a client owner.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/msps/{mspId}/clients/{clientId}/members | List client team members |
| GET | /api/msps/{mspId}/clients/{clientId}/members/{userId} | Get a specific client member |
| PUT | /api/msps/{mspId}/clients/{clientId}/members/{userId} | Update a client member's roles |
| DELETE | /api/msps/{mspId}/clients/{clientId}/members/{userId} | Remove a client member |
Available client member roles: owner, admin, devops, user, reader.
Error Responses
| Status | Message | Cause |
|---|---|---|
| 400 | Input failed data validation | Missing or invalid fields in the request body |
| 404 | Client not found | The clientId does not exist or is not linked to this MSP |
| 403 | Forbidden | Insufficient role to perform this operation |