post:
  operationId: setPassword
  tags:
    - Password Management
  summary: Set Identity's Password
  description: |
    This API is used to set a password for an identity. 
    
    An identity can change their own password if they use a token generated by their IDN user, such as a [personal access token](https://developer.sailpoint.com/idn/api/authentication#personal-access-tokens) or ["authorization_code" derived OAuth token](https://developer.sailpoint.com/idn/api/authentication#authorization-code-grant-flow).
    
    A token with [API authority](https://developer.sailpoint.com/idn/api/authentication#client-credentials-grant-flow) can be used to change **any** identity's password.  "API authority" refers to a token that only has the "client_credentials" grant type.
  requestBody:
    required: true
    content:
      application/json:
        schema:
          $ref: '../schemas/PasswordChangeRequest.yaml'
        example: {
          "identityId": "8a807d4c73c545510173c545f0a002ff",
          "encryptedPassword": "GIAP7TaAg7Y2EJtFojokBDvHQ/iXF3qk0z0+eLusqXMSkEhAfr34GydFLy+BM2uZB94cwbTYKi9rRrCRRdh8610VeqpRDjhuc28nOPYqTJOx09IGJdr8dl4mbhC1f21JCqMBBrFSA4VQQvd6OMVsceoXTjDI0aKahRYNjlMlsOuaIUZeNQxWBydLuR6vYG3qAKEPCzYZbvyYuBUylUWArfqwV4dgwKGDgDkTLBkQU9LVu3rssc+BXaex6l6JcBDiPg7wvKD1G3lZ+BaGrMknbx3j0T2Uivg+HxwTf7PmtAua6O9M7F984c79KM+sYFTU37MAdlWZu/cy+w2DdHVdCg==",
          "publicKeyId": "YWQ2NjQ4MTItZjY0NC00MWExLWFjMjktOGNmMzU3Y2VlNjk2",
          "accountId": "CN=Abby Smith,OU=Austin,OU=Americas,OU=Demo,DC=seri,DC=acme,DC=com",
          "sourceId": "8a807d4c73c545510173c545d4b60246"
        }
  responses:
    '202':
      description: Reference to the password change.
      content:
        application/json:
          schema:
            $ref: '../schemas/PasswordChangeResponse.yaml'
          examples:
            Password change is in progress:
              value:
                {
                  "state": "IN_PROGRESS",
                  "requestId": "089899f13a8f4da7824996191587bab9",
                }
    '400':
      $ref: '../../v3/responses/400.yaml'
    '401':
      $ref: '../../v3/responses/401.yaml'
    '403':
      $ref: '../../v3/responses/403.yaml'
    '429':
      $ref: '../../v3/responses/429.yaml'
    '500':
      $ref: '../../v3/responses/500.yaml'