Using API v1? See what changes in v2, or the v1 docs
AUTH_SANDBOX_MISMATCH
A test key was used with live data, or a live key was used with sandbox data.
HTTP status: 403. Retrying the same request returns the same error.
What to do
Check which key your environment loads. Test keys start with pyas_sk_test_. Live keys start with pyas_sk_ and do not include test_. To test connecting accounts in the sandbox, use PyasConnect with a connect session created with your test key.
Hint returned with the error: Use a test key for sandbox requests and a live key for real connections.
Why it happens
- API keys swapped between environments
- A request that only works with real accounts was sent with a test key: an account import, or connecting without PyasConnect (
GET /v2/connect/oauth)
Endpoints that return it
- Import accounts
POST /v2/accounts/import - Connect an account with a code
POST /v2/connect/accounts - Get a sign-in URL
GET /v2/connect/oauth - Stream sandbox webhook events
GET /v2/webhooks/listen - Get the sandbox
GET /v2/sandbox - Reset the sandbox
POST /v2/sandbox/reset - Simulate an external change
POST /v2/sandbox/simulate-change - Simulate a Zoom meeting event
POST /v2/sandbox/simulate-meeting - Simulate an invitation response
POST /v2/sandbox/simulate-reply