Okta POST API Call Fails With HTTP Method Not Supported Error
Last Updated:
Overview
A POST API call fails with an HTTP method not supported error because the API token expired, permissions are insufficient, or the URL variable lacks the HTTPS protocol. Resolve this issue by verifying the API token permissions and ensuring the URL variable includes the full HTTPS protocol. Okta generates the following error message during the API call:
The endpoint does not support the provided HTTP method","errorLink":"E0000022"
Applies To
- Okta Identity Engine (OIE)
- Okta Classic Engine
- POST API Calls
- Postman
Cause
This error occurs due to an expired API token, insufficient permissions, or a missing https:// protocol in the URL variable used within the API call. While GET calls function without the full URL, POST calls require the complete URL. For example, <OktaDomain.okta.com> fails on a POST call, but https://<OktaDomain.okta.com> succeeds. Review the E0000022: HTTP request method not supported exception documentation for more details on token and permission issues.
Solution
How is the HTTP method not supported error resolved?
Ensure the default call URL includes the https:// protocol.
Update the environment variables in the API client to include the full HTTPS protocol by following these steps.
- Click the Environment quick look icon on the right side of the Postman application.
- Locate the Variable URL and review the Initial Variable and Current Variable values.
- Set the Current Variable to
https://<InsertOktaDomain.okta.com>. - Save the changes.
- Hover over the URL within the API call to verify it displays the full link.
- Execute the POST call and verify it returns a 200 OK response code.
