Skip to content

Replace user's auth based on configured company auth type

Request

Replace the user's authentication values from scratch. The authentication type is derived from the company config.

Security
oauth2(Required scopes: user.auth:update) or bearerAuth or apiKeyHeader
Path
userIdstring(AnyId)^ext-|^[A-Z][A-Z0-9]-[A-Z0-9]+-[A-Z0-9]+|^\d+$write-onlyrequired

Unique user identifier.

Bodyapplication/jsonrequired
One of:
emailstringrequired

The email address to use for the new auth.

passwordstring or null

The new password to use. Only applicable for basic auth.

PUT
/users/{userId}/auth
curl -i -X PUT \
  'https://sandboxapi.peach.finance/api/users/{userId}/auth' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "email": "string",
    "password": "string"
  }'

Responses

Success

Bodyapplication/json
messagestring

Description of the server action or error.

statusinteger

HTTP status code.

dataobject(UserAuth)read-only
Response
{ "message": "string", "status": 0, "data": { "authType": "basic", "authValueType": "email", "value": "string" } }