Setup & Authentication
API Authentication
Authentication
CIPP uses OAuth authentication to be able to connect to the API using your Application ID and secret. You can use the PowerShell example below to connect to the API
$CIPPAPIUrl = "https://yourcippurl.com"
$ApplicationId = "your application ID"
$ApplicationSecret = "your application secret"
$TenantId = "your tenant id"
$AuthBody = @{
client_id = $ApplicationId
client_secret = $ApplicationSecret
scope = "api://$($ApplicationId)/.default"
grant_type = 'client_credentials'
}
$token = Invoke-RestMethod -Uri "https://login.microsoftonline.com/$TenantId/oauth2/v2.0/token" -Method POST -Body $AuthBody
$AuthHeader = @{ Authorization = "Bearer $($token.access_token)" }
Invoke-RestMethod -Uri "$CIPPAPIUrl/api/ListLogs" -Method GET -Headers $AuthHeader -ContentType "application/json"
Time and rate limits
The API actions have a maximum timeout of 10 minutes. There are no active rate limits, but heavy usage of the API can cause frontend operations to slow down.
Endpoint documentation
CIPP API Powershell Module
You can install the CIPP API Powershell module using PowerShell 7.x. The module takes care of all the authentication for you.
Install-Module -Name CIPPAPIModule
You will first need to set your CIPP API Details using the following command:
Set-CIPPAPIDetails -CIPPClientID "YourClientIDGoesHere" -CIPPClientSecret "YourClientSecretGoesHere" -CIPPAPIUrl "https://your.cipp.apiurl" -TenantID "YourTenantID"
You can then test its working
Get-CIPPLogs
Further documentation for the module and each of its available functions can be found here
Feature Requests / Ideas
We value your feedback and ideas. Please raise any feature requests on GitHub.
Last updated
Was this helpful?