ConnectWise Automate Client Management
Overview
Clients in ConnectWise Automate represent customer organizations. Each client can have multiple locations (physical sites), and computers belong to specific locations within clients. This skill covers client CRUD operations, location management, client-level settings, and group configurations.
Key Concepts
Client Hierarchy
Client (Organization)
├── Location 1 (Physical Site)
│ ├── Computer A
│ └── Computer B
├── Location 2
│ └── Computer C
└── Client Settings
├── EDFs (Custom Fields)
├── Groups
└── Policies
Client Identifiers
| Identifier | Type | Description | Example |
|---|---|---|---|
ClientID | integer | Primary key, auto-incrementing | 100 |
Name | string | Client display name | Acme Corporation |
ExternalID | string | External system reference | CW-12345 |
City | string | Primary city | Chicago |
Location Identifiers
| Identifier | Type | Description | Example |
|---|---|---|---|
LocationID | integer | Primary key | 1 |
Name | string | Location name | Main Office |
ClientID | integer | Parent client | 100 |
Address | string | Street address | 123 Main St |
Field Reference
Client Fields
interface Client {
// Identifiers
ClientID: number; // Primary key
Name: string; // Display name
ExternalID: string; // External reference
// Contact Information
Address1: string; // Street address line 1
Address2: string; // Street address line 2
City: string; // City
State: string; // State/Province
Zip: string; // Postal code
Country: string; // Country
Phone: string; // Primary phone
Fax: string; // Fax number
Website: string; // Website URL
// Primary Contact
ContactName: string; // Primary contact name
ContactEmail: string; // Primary contact email
ContactPhone: string; // Primary contact phone
// Settings
Comment: string; // Client notes
DefaultRouterAddress: string; // Default gateway
DateAdded: string; // Creation date
// Counts
ComputerCount: number; // Total computers
LocationCount: number; // Total locations
// Extra Data Fields
ExtraData: {
[key: string]: string;
};
}
Location Fields
interface Location {
// Identifiers
LocationID: number; // Primary key
ClientID: number; // Parent client
Name: string; // Location name
// Address
Address1: string;
Address2: string;
City: string;
State: string;
Zip: string;
Country: string;
Phone: string;
// Network
Router: string; // Default router IP
NetworkProbe: number; // Network probe computer ID
// Settings
Comment: string; // Location notes
DateAdded: string; // Creation date
// Counts
ComputerCount: number; // Computers at this location
// Extra Data Fields
ExtraData: {
[key: string]: string;
};
}
Group Fields
interface Group {
GroupID: number; // Primary key
Name: string; // Group name
FullPath: string; // Full hierarchy path
ParentID: number; // Parent group ID
ClientID: number; // 0 for global groups
Template: number; // Template group ID
AutoJoinScript: number; // Auto-join script ID
// Limits
LimitToParent: number; // Limit to parent group
NetworkProbe: number; // Network probe
// Scripts
Scripts: number[]; // Associated script IDs
Monitors: number[]; // Associated monitor IDs
}
API Patterns
List All Clients
GET /cwa/api/v1/Clients?pageSize=250
Authorization: Bearer {token}
Response:
[
{
"ClientID": 100,
"Name": "Acme Corporation",
"City": "Chicago",
"State": "IL",
"Phone": "(312) 555-1234",
"ContactName": "John Smith",
"ContactEmail": "jsmith@acme.com",
"ComputerCount": 45,
"LocationCount": 3,
"DateAdded": "2020-01-15T08:00:00Z"
}
]
Get Single Client
GET /cwa/api/v1/Clients/{clientID}
Authorization: Bearer {token}
Create Client
POST /cwa/api/v1/Clients
Authorization: Bearer {token}
Content-Type: application/json
{
"Name": "New Client Inc",
"Address1": "456 Business Ave",
"City": "New York",
"State": "NY",
"Zip": "10001",
"Phone": "(212) 555-9876",
"ContactName": "Jane Doe",
"ContactEmail": "jdoe@newclient.com"
}
Response:
{
"ClientID": 101,
"Name": "New Client Inc",
"City": "New York",
"DateAdded": "2024-02-15T10:30:00Z"
}
Update Client
PATCH /cwa/api/v1/Clients/{clientID}
Authorization: Bearer {token}
Content-Type: application/json
{
"Phone": "(212) 555-1111",
"ContactEmail": "newcontact@newclient.com"
}
Delete Client
DELETE /cwa/api/v1/Clients/{clientID}
Authorization: Bearer {token}
Note: Deleting a client will also delete all associated locations and unassign computers.
List Client Locations
GET /cwa/api/v1/Clients/{clientID}/Locations
Authorization: Bearer {token}
Response:
[
{
"LocationID": 1,
"ClientID": 100,
"Name": "Main Office",
"City": "Chicago",
"State": "IL",
"ComputerCount": 30
},
{
"LocationID": 2,
"ClientID": 100,
"Name": "Remote Office",
"City": "Detroit",
"State": "MI",
"ComputerCount": 15
}
]
Create Location
POST /cwa/api/v1/Clients/{clientID}/Locations
Authorization: Bearer {token}
Content-Type: application/json
{
"Name": "New Branch Office",
"Address1": "789 Branch St",
"City": "Detroit",
"State": "MI",
"Zip": "48201"
}
Get Client Computers
GET /cwa/api/v1/Clients/{clientID}/Computers?pageSize=250
Authorization: Bearer {token}
Get Client Groups
GET /cwa/api/v1/Clients/{clientID}/Groups
Authorization: Bearer {token}
Get Client EDFs
GET /cwa/api/v1/Clients/{clientID}/ExtraDataFields
Authorization: Bearer {token}
Response:
[
{
"EDFID": 1,
"Name": "Contract Type",
"Value": "Managed Services",
"Type": "Text"
},
{
"EDFID": 2,
"Name": "SLA Level",
"Value": "Premium",
"Type": "Dropdown"
}
]
Update Client EDF
PUT /cwa/api/v1/Clients/{clientID}/ExtraDataFields/{edfID}
Authorization: Bearer {token}
Content-Type: application/json
{
"Value": "Gold"
}
Workflows
Client Lookup by Name
async function findClientByName(client, name) {
const clients = await client.request(
`/Clients?condition=Name contains '${name}'`
);
if (clients.length === 0) {
return { found: false, suggestions: [] };
}
if (clients.length === 1) {
return { found: true, client: clients[0] };
}
return {
found: false,
ambiguous: true,
suggestions: clients.map(c => ({
name: c.Name,
id: c.ClientID,
city: c.City,
computerCount: c.ComputerCount
}))
};
}
Create Client with Default Location
async function createClientWithLocation(apiClient, clientData, locationName = 'Main Office') {
// Create the client
const newClient = await apiClient.request('/Clients', {
method: 'POST',
body: JSON.stringify(clientData)
});
// Create default location
const location = await apiClient.request(
`/Clients/${newClient.ClientID}/Locations`,
{
method: 'POST',
body: JSON.stringify({
Name: locationName,
Address1: clientData.Address1,
City: clientData.City,
State: clien