Lint a REST request
pc_validate_requestValidate a Partner Center REST request before sending: identifies mismatched method/path, missing headers, unsupported app-only auth, and sovereign-cloud host errors.
Instructions
Check a Partner Center REST request you have already written against the documented operations and report what is wrong: unrecognised or mismatched method and path, missing Authorization or MS-RequestId, a retired token audience, app-only used where it is not supported, and sovereign-cloud host mismatches. Use this to catch mistakes before sending, or to explain a call that is failing. To build a correct request from scratch instead, use pc_build_request; to decode a response you already received, use pc_decode_error. Read-only, offline, deterministic: the request is analysed statically and never sent, so pass placeholder tokens rather than real ones. Findings are limited to what the bundled pack covers, so an empty list means no known problem — not a guarantee the call will succeed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The request URL. A full URL or a bare path both work; the scheme and host are stripped before matching. Concrete ids in place of {placeholder} segments are expected and matched positionally, e.g. "https://api.partnercenter.microsoft.com/v1/customers/c7f6.../subscriptions". A query string is ignored. | |
| cloud | No | Sovereign cloud the request targets. Defaults to "commercial". Supply a non-commercial value to get the correct base URL and login authority reported as an info finding. | |
| method | Yes | HTTP verb of the request you are checking. Required — a verb that does not match the endpoint is one of the things this reports. | |
| headers | No | Request headers as a flat string-to-string map, e.g. { "Authorization": "Bearer <token>", "MS-RequestId": "..." }. Names are compared case-insensitively. Omit to skip the header checks entirely — which also suppresses the missing-Authorization finding. Use placeholder token values; real ones are unnecessary. | |
| authType | No | The token flavour you intend to use. Supply it to be told when the endpoint does not accept app-only. Omit to skip that check. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | True when the call succeeded and `data` is populated; false when `error` explains why not. | |
| data | No | The result payload. Present only when `ok` is true. | |
| error | No | Human-readable reason the call failed. Present only when `ok` is false. |