Start a test sign-in
/portal/v1/accounts/{accountSlug}/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
AuthorizationJWT access token. Never send alongside X-API-Key: a request carrying both is refused.
sso.manageSecurityManage SSO connections, domains, and directory sync. Granted through an administrator role in the Admin Workspace; a valid token without it is refused with 403.
Path Parameters
accountSlugstring Required The Account's slug. An unknown one answers 404.
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.
account.capability_requiredForbiddenThe signed-in user's administrator roles do not grant the capability this endpoint requires.
Ask an account administrator to grant a role carrying the capability named in the Authentication section, then retry.
Returned object
curl -X POST "https://auth.canopy-io.com/portal/v1/accounts/value/sso/connections/value/test" \ -H "Authorization: Bearer $CANOPY_TOKEN" \ -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.