Start a test sign-in
/api/v1/sso/connections/{id}/testCreates a test sign-in for an end-user connection inside one of the Environments it is bound to. The connection must carry its protocol's required fields but need not be active. The response's start_url runs the real identity-provider round-trip: the callback verifies the assertion, maps the attributes, and judges the email's domain against the bound organization's verified claims, then records the outcome instead of provisioning an identity or issuing a session. Audits sso.connection.test_executed on completion; never sso.login.*, so tests stay out of the recent-logins feed. The test expires after 15 minutes.
Authentication
Authorization Option A JWT access token. Never send alongside X-API-Key: a request carrying both is refused.
X-API-Key Option B API key for management-tier access. Never send alongside an Authorization header: a request carrying both is refused.
sso.manageAccountCreate, update, and delete SSO connections, verified domains and SCIM tokens. A scoped API key must hold it as a scope; a full-access key holds every scope within its Environment except the named-only and account scopes; a developer's token needs the Console capability that covers it. A credential without it is refused with 403.
Path Parameters
idstring Required Request body
application/json
environment_idstring Required The Environment the test runs in. The connection must be bound to it; routing and the domain check are judged there.
Responses
application/json
data *SsoTestSignInResponseDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
Errors
When the request can't be completed, the response body includes a stable error code you can branch on, and a correlation_id (also sent as the X-Correlation-Id header). Quote the correlation id when you contact support: it identifies the exact request in Canopy's logs. A request refused by an authorization check answers 403 with the code authorization.denied, and its data names the denial_reason and the permission checked.
authorization.deniedForbiddenThe credential does not hold the permission this operation checks: a scoped API key without the scope, a developer without the Console capability that covers it, or a permission granted somewhere other than the node the request targets. The error's data names the permission.
Add the permission named in the Authentication section to the key's scopes, or ask an account administrator to grant the covering capability, then retry. For a node-scoped operation, make sure the grant reaches the node you are acting on.
Returned object
curl -X POST "https://auth.canopy-io.com/api/v1/sso/connections/value/test" \ -H "X-API-Key: $CANOPY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "environment_id": "string" }'
{ "data": { "id": "string", "connection_id": "string", "environment_id": "string", "type": "saml", "status": "pending", "start_url": "string", "started_at": "2026-04-20T12:00:00.000Z", "expires_at": "2026-04-20T12:00:00.000Z", "outcome": "success", "reason": "string", "email": "string", "first_name": "string", "last_name": "string", "federated_subject_id": "string", "amr": [ "string" ], "domain_outcome": "accepted", "missing_fields": [ "string" ], "received_attributes": [ "string" ], "name_id_format": "string", "hint": "set_name_id_email", "completed_at": "2026-04-20T12:00:00.000Z" } }
Tell us how we can improve this guide.