A template project for the SailPoint Python SDK. It is initialized using the SailPoint CLI and provides working examples of common Identity Security Cloud API calls using the Python SDK.
- Python 3.7+ — check with
python --version(download) - SailPoint CLI installed and configured (installation guide)
- A SailPoint Identity Security Cloud tenant
- A Personal Access Token (PAT) with a client ID and client secret (creating a PAT)
Use the SailPoint CLI to create a new project from this template:
sail sdk init python py-exampleThis creates the following structure:
py-example/
├── requirements.txt
└── sdk.py
cd py-examplepip install -r requirements.txtTip: Use a virtual environment to isolate dependencies:
python -m venv .venvthensource .venv/bin/activate(Linux/macOS) or.venv\Scripts\activate(Windows).
The SDK needs credentials to authenticate with your SailPoint tenant. Generate a config.json file using the CLI:
sail sdk init configIf you have multiple environments configured in the CLI, specify which one to use:
sail sdk init config --env devrelThis creates a config.json in the project directory:
{
"ClientId": "your-client-id",
"ClientSecret": "your-client-secret",
"BaseURL": "https://[tenant].api.identitynow.com"
}You can also use environment variables (SAIL_BASE_URL, SAIL_CLIENT_ID, SAIL_CLIENT_SECRET) instead of a config file.
Tip: Add
config.jsonto your.gitignoreso credentials are not committed to version control.
python sdk.pyThe sdk.py file contains several example operations demonstrating common SDK usage:
| Operation | API | SDK Class |
|---|---|---|
| List transforms | V3 | TransformsApi |
| List access profiles | V3 | AccessProfilesApi |
| Search identities (with pagination) | V3 | SearchApi + Paginator |
| Paginate accounts | V3 | AccountsApi + Paginator |
| List governance groups (workgroups) | Beta | GovernanceGroupsApi |
You can extend the script with any V3 or Beta API endpoints.
- Change the API — swap
TransformsApifor another API such asAccountsApiorSourcesApi. - Change the method — use different methods on the API client for your use case.
- See the Getting Started guide for more examples.