RequestRocketRequestRocketDocs
API ReferenceMSP API

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

MethodEndpointDescriptionMin Role
GET/api/msps/{mspId}/clientsList all managed clientsmsp_reader
GET/api/msps/{mspId}/clients/{clientId}Get a specific managed clientmsp_reader
POST/api/msps/{mspId}/clientsCreate a new client organisationmsp_admin
PUT/api/msps/{mspId}/clients/{clientId}Update a client organisationmsp_admin
DELETE/api/msps/{mspId}/clients/{clientId}Remove a client from your MSPmsp_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

FieldTypeRequiredDescription
clientNamestringYesDisplay 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

FieldTypeRequiredDescription
clientNamestringNoNew 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"
}

Detach Client

Ends the managed-service relationship between the MSP and the client. This does not delete the client organisation.

Detach is rejected with 409 unless all of the following are true:

  • The client has an independent owner member
  • Client configuration billingTo is not "msp" (switch billing to the client first)

To delete an MSP-created client that still has no members, use DELETE /api/clients/{clientId} instead.

Detaching does not deprovision the client. If the client has no owner, or billing is still charged to the MSP, the request is rejected.

Request

DELETE /api/msps/{mspId}/clients/{clientId} HTTP/1.1
Host: api.requestrocket.com
Authorization: {user_token}

Response

{
  "message": "Client detached from MSP"
}

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.

MethodEndpointDescription
GET/api/msps/{mspId}/clients/{clientId}/membersList 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 for MSPs: admin, devops, user, reader. Only a systemAdmin can assign or remove the owner role. An owner member cannot be removed.


Error Responses

StatusMessageCause
400Input failed data validationMissing or invalid fields in the request body
404Client not foundThe clientId does not exist or is not linked to this MSP
403ForbiddenInsufficient role to perform this operation
409Cannot detach client - it has no independent ownerAssign an owner before detaching
409Cannot detach client - billing is currently charged to the MSPSwitch billingTo to client before detaching

Next Steps

On this page