Find a workspace ID
When using most API endpoints, you need to specify a workspace ID.
Find the workspaces you have access to by using the GET /v1/user
endpoint. The domain of each workspace is its ID.
auth_header="Authorization: <API Token>" uri="https://<CD4PE hostname>/cd4pe/api/v1/user curl --insecure --header "$auth_header" --request GET "$uri”
This returns information about your workspaces. For example, it might look similar to the following:
{ "user" : { ... }, "workspaces" : [ { "domain" : "d6", "name" : "example_workspace_1" }, { "domain" : "d7", "name" : "example_workspace_2" } ] }
Use the workspace ID as needed for API endpoints, such as finding your Puppet Enterprise environment node group ID, triggering an impact analysis, and triggering a deployment.