- API Hub for Contract Testing Documentation
- User Guide
- Troubleshooting
- Authorization Errors
Authorization Errors
Getting a 401 Unauthorized when publishing or verifying pacts
The most common reasons for API authentication failures are:
Using an old version of Pact library that does not support the API Hub for Contract Testing authentication scheme (bearer token authentication).
To resolve this, make sure you are using the latest Pact library version for your language.
Attempting to access the API with a username and password instead of an API token.
To resolve this, please see the section on configuring your API token
Using a read-only token instead of a read/write token
To resolve this, please see the section on configuring your API token and ensure you have copied the read/write token.
In this section: