Make direct HTTP requests to any iTwin Platform API endpoint. Useful for custom operations or accessing APIs without dedicated commands.
-
--body
The body to include in the request. It must be serialized JSON.
Type:stringRequired: No -
--empty-response
Indicates the request will not return a response body.
Type:flagRequired: No -
--header
Headers to include in the request. Use the format 'HeaderName: value'.
Type:stringRequired: No Multiple: Yes -
--method
HTTP method for the request.
Type:stringRequired: Yes
Valid Values:"GET","POST","PUT","DELETE","PATCH" -
--path
API endpoint path to send the request to.
Type:stringRequired: Yes -
--query
URL query parameters for the request. Use format 'QueryKey:value'.
Type:stringRequired: No Multiple: Yes -
--version-header
API version header for versioned endpoints.
Type:stringRequired: No
# Example 1: Sending a GET request
itp api --method GET --path users/me
# Example 2: Sending a request with headers and query parameters
itp api --method GET --path itwins/favorite --query subClass:Account --query "$top:10" --header "Prefer: return=minimal"
# Example 3: Sending a delete request without response body
itp api --method DELETE --path itwins/favorites/dc914a84-e0c9-40e2-9d14-faf5ed84147f --empty-response
# Example 4: Sending a post request
itp api --method POST --path itwins/exports --body '{"outputFormat": "JsonGZip"}'
# Example 5: Sending a post request (Windows PowerShell)
itp api --method POST --path users/getbyidlist --body "[\`"b644de17-f07e-4b43-8c33-ad2b1bacee3b\`"]"