PDQ Connect provides an HTTP based, REST-style API that enables admins to securely integrate with their own scripts, integrations, and other tools. The API allows admins to read and search for device details, such as which software packages and versions and updates are installed, network and disk information, and more. The API can also be used to deploy software to devices using simple HTTP requests.
More detailed API usage documentation is available at https://app.pdq.com/v1/docs.
Authentication
Before you can use the API, you will need to set up authentication using Connect’s secure, token-based authentication system.
PDQ Connect only accepts encrypted HTTPS requests.
First, generate a new API key using the new “API key management” page in Connect’s settings page located in the lower left-hand corner of the console. |
Then, in the “API keys” page, click on the “Create API key” button. Give your API key a descriptive name that helps you remember what you are using it for. This helps if you create more than one. Then press the “Create” button to generate the key. |
After you press the “Create” button, you will be given an opportunity to copy the API key to your computer’s clipboard. Press the copy button to the right of the hidden API key to copy it. Make sure to save the API key somewhere safe, as this is the only chance you have to see the API key. If you lose it, you will have to make a new one. |
Request Header Authentication
To use the new API key you generated, you will need to include it in an HTTP header to the Connect API endpoint. It must be included in each request.
Invoke-RestMethod -Uri https://app.pdq.com/v1/api/devices -Headers @{'Authorization' = 'Bearer API_KEY_HERE'}
You can now use the API key to interact with the Connect API. If you ever stop using an API key or if you have reason to believe your key has been viewed by someone who shouldn’t have API access, remember to revoke the API key as soon as possible. You can revoke a key by pressing the “Revoke” button and following the prompts.
Examples using PowerShell
Get Devices
#Get Devices
$ConnectApiBaseUrl = "https://app.pdq.com/v1/api"
$ConnectApiToken = "YOUR CONNECT API TOKEN"
$headers = @{'authorization' = "Bearer $ConnectApiToken" }
Invoke-RestMethod -Headers $headers -Uri "$ConnectApiBaseUrl/devices"
Get groups
#Get groups
$ConnectApiBaseUrl = "https://app.pdq.com/v1/api"
$ConnectApiToken = "YOUR CONNECT API TOKEN"
$headers = @{'authorization' = "Bearer $ConnectApiToken" }
Invoke-RestMethod -Headers $headers -Uri "$ConnectApiBaseUrl/groups"
Get devices in group
#Get devices in group
$ConnectApiBaseUrl = "https://app.pdq.com/v1/api"
$ConnectApiToken = "YOUR CONNECT API TOKEN"
$headers = @{'authorization' = "Bearer $ConnectApiToken" }
Invoke-RestMethod -Headers $headers -Uri "$ConnectApiBaseUrl/devices?group=[groupId]"
Get packages by name contains
#Get packages by name contains
$ConnectApiBaseUrl = "https://app.pdq.com/v1/api"
$ConnectApiToken = "YOUR CONNECT API TOKEN"
$headers = @{'authorization' = "Bearer $ConnectApiToken" }
Invoke-RestMethod -Headers $headers -Uri "$ConnectApiBaseUrl/packages?filter[name]=~windows"
Get package versions
#Get package versions
$ConnectApiBaseUrl = "https://app.pdq.com/v1/api"
$ConnectApiToken = "YOUR CONNECT API TOKEN"
$headers = @{'authorization' = "Bearer $ConnectApiToken" }
Invoke-RestMethod -Headers $headers -Uri "$ConnectApiBaseUrl/packages/[packageId]"
Start a deployment
#Start a deployment
$ConnectApiBaseUrl = "https://app.pdq.com/v1/api"
$ConnectApiToken = "YOUR CONNECT API TOKEN"
$headers = @{'authorization' = "Bearer $ConnectApiToken" }
Invoke-RestMethod -Headers $headers -Method Post -Uri "$ConnectApiBaseUrl/deployments?package=[packageId, or packageVersionId]&targets=[deviceId or groupId]"
Example using Postman
Get Devices
In the Headers tab, add a key called Authorization, with a value of Bearer followed by a single space followed by your Connect API key. No brackets or single/double quotes are required - just a single space between the Bearer and the API key.
Rate Limits
The API is rate limited to 300 requests every 2 minutes per organization.
The API will only return up to 100 responses at a time, so if you are querying more than 100 objects (devices, packages, etc.), then you will need to submit multiple requests which step through the results by page. See this blogpost for detailed instructions.