POST users.reset_password - ocariot/api-gateway GitHub Wiki

Description

Creates a new password for the user.

Permissions:

  • Only the administrator can do this for any user.

Scope

users:resetPassword

URL

POST https://localhost/v1/users/{user_id}/reset-password

Parameters

user_id: string (A 24-byte hex ID)

Request body

{
  "new_password": "new_password_here"
}

Curl example

curl -X POST "https://localhost/v1/users/5a62be07de34500146d9c544/reset-password" -H "accept: /" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d "{"new_password":"new_password_here"}"

Response body

  • 204 Operation successfully performed. The password has been updated and no data to be returned.

  • 400 Validation errors

    • Invalid JSON format

    • Invalid user_id

    • Missing field

      • Pattern
      {
        "code": 400,
        "message": "Required field not provided...",
        "description": "{field name} is required!"
      }
      
      • Example
      {
        "code": 400,
        "message": "Required fields were not provided...",
        "description": "new_password is required!"
      }
      
    • Empty string

      • Example
      {
        "code": 400,
        "message": "One or more request fields are invalid...",
        "description": "new_password must have at least one character!"
      }
      
    • Invalid string

      • Example
      {
        "code": 400,
        "message": "One or more request fields are invalid...",
        "description": "new_password must be a string!"
      }
      
  • 401 Unauthorized Error

  • 403 Permission Error

  • 404 Not Found Error

  • 429 Too Many Requests Error

  • 500 Internal Server Error