Set an identity's password (admin)
/api/v1/identities/{id}/passwordSets an identity's password directly (server-to-server admin), primarily for migrating users off a legacy store without the user present. Reuses the argon2id + HaveIBeenPwned path, so a breached password returns 400; the prior hash is recorded to password history, any active failed-login lockout is cleared, and the identity's active sessions are revoked so a rotated credential can't keep a stale session alive. Returns 204 No Content; returns 404 when the identity has no membership in this Environment.
Authentication
Authorization Option A JWT access token
X-API-Key Option B API key for management-tier access
Path Parameters
idstring Required Request body
application/json
passwordstring Required New password (8–64 chars). NIST SP 800-63B aligned — no composition rules. HaveIBeenPwned breach check runs server-side.
Responses
Password set. The identity's existing sessions are revoked and any active failed-login lockout is cleared; the new password takes effect on next sign-in. Intended for backend/admin tooling (e.g. migrating users off a legacy store).
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
curl -X POST "https://auth.canopy-io.com/api/v1/identities/value/password" \ -H "X-API-Key: $CANOPY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "password": "string" }'
HTTP/1.1 204 Password set. The identity's existing sessions are revoked and any active failed-login lockout is cleared; the new password takes effect on next sign-in. Intended for backend/admin tooling (e.g. migrating users off a legacy store). (empty body)
Tell us how we can improve this guide.