> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rdp.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Reset Password

> Sets a new random password on the server, as "Reset Password" in the panel does,
and answers with it. `GET /servers/{server}` shows the same password from then on.
The password is random and goes through your systems, so have your customer
choose one of their own.

What is left to do depends on `outcome`:

- `changed`: nothing. The server already runs on the new password.
- `changed_restart`: restart the server. A Linux server takes the new password
  when it restarts. A Windows server already runs on it and sets it again at its
  next start, so restart it before choosing another password.
- `changed_stop_start`: stop the server and start it again. It takes the new
  password at its next start, and a restart is not enough.




## OpenAPI

````yaml post /servers/{server}/password/reset
openapi: 3.1.0
info:
  title: APIFiddle Sample Definition
  version: 0.0.0
  description: Example workspace
servers:
  - url: https://rdp.sh/api/v1
    description: Default production endpoint.
security: []
paths:
  /servers/{server}/password/reset:
    post:
      summary: Reset the password
      description: >
        Sets a new random password on the server, as "Reset Password" in the
        panel does,

        and answers with it. `GET /servers/{server}` shows the same password
        from then on.

        The password is random and goes through your systems, so have your
        customer

        choose one of their own.


        What is left to do depends on `outcome`:


        - `changed`: nothing. The server already runs on the new password.

        - `changed_restart`: restart the server. A Linux server takes the new
        password
          when it restarts. A Windows server already runs on it and sets it again at its
          next start, so restart it before choosing another password.
        - `changed_stop_start`: stop the server and start it again. It takes the
        new
          password at its next start, and a restart is not enough.
      operationId: resetServerPassword
      parameters:
        - $ref: '#/components/parameters/server'
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                title: ResetServerPasswordOk
                properties:
                  status:
                    type: boolean
                    examples:
                      - true
                  outcome:
                    type: string
                    enum:
                      - changed
                      - changed_restart
                      - changed_stop_start
                    description: What is left to do, see above.
                    examples:
                      - changed_restart
                  message:
                    type: string
                    examples:
                      - >-
                        Password has been changed. Please restart your server
                        before you change it to a password of your own choice.
                  username:
                    type: string
                    examples:
                      - Administrator
                  password:
                    type: string
                    examples:
                      - Pv93xK2mQ8sL
          description: The password was changed.
        '403':
          content:
            application/json:
              schema:
                type: object
                title: ResetServerPasswordUnauthorized
                properties:
                  status:
                    type: boolean
                    examples:
                      - false
                  error:
                    type: string
                    examples:
                      - This action is unauthorized
          description: User does not own the server.
        '404':
          description: Server not found.
        '409':
          content:
            application/json:
              schema:
                type: object
                title: ResetServerPasswordConflict
                properties:
                  status:
                    type: boolean
                    examples:
                      - false
                  outcome:
                    type: string
                    enum:
                      - no_answer
                      - not_accepted
                      - no_drive
                      - password_ignored
                      - not_written
                      - busy
                    description: >-
                      Left out when the server is suspended, or is being
                      installed or moved.
                    examples:
                      - no_answer
                  error:
                    type: string
                    examples:
                      - >-
                        Your server did not respond, so its password was not
                        changed. Please make sure it is running and try again.
          description: >
            The password was not changed. Either the server is suspended or is
            being installed

            or moved, or `outcome` says why:


            - `no_answer`: the guest agent of a Windows server did not respond.
            Make sure the server is running and try again.

            - `not_accepted`: Windows did not accept the new password. Try again
            in a few minutes.

            - `no_drive`: the server has no cloud-init drive. Contact support.

            - `password_ignored`: the server was deployed with preinstalled
            software. Contact support.

            - `not_written`: the password could not be written. Try again in a
            few minutes.

            - `busy`: another reset of this server is still running. Try again
            in a minute.
        '429':
          description: >
            Too many resets: 5 every 2 minutes per server and 30 a minute per
            account.

            Refused resets count too.
      security:
        - Authorization: []
components:
  parameters:
    server:
      in: path
      name: server
      schema:
        type: string
      required: true
  securitySchemes:
    Authorization:
      in: header
      name: Authorization
      type: apiKey
      description: |
        Your API key as it is, without `Bearer`. API access is off for new
        accounts: until it is turned on under Settings > API, every request
        answers `403` with `API access is turned off for this account. Turn it
        on under Settings > API.` If the account lists allowed IPs, a request
        from any other address answers `403` with `This API key is not allowed
        from <address>`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.