Skip to content

Passwords

Teamwire admins need a password in order to be able to login. They may also need to recover the password in case it was forgotten.


Admin account passwords

Request PIN for password reset

POST /v<api_version>/admin/password/

This endpoint can be used when an admin can’t remember her password. Calling it will cause a text message (SMS) to be sent to the admin’s mobile phone number containing a PIN which she can use to set a new password.

URL parameters

The following parameters are specified as part of the URL, i.e. /<parameter>/:

Name Type Optional For use by Description
api_version String No All admins The Enterprise API version targeted.

POST data

Parameters are supplied as a JSON object with the following elements:

Name Type Optional For use by Description
email String No All admins The admin’s email address.
mobile String No All admins The admin’s mobile phone number.

Result

The following return values indicate the outcome of the API call:

HTTP status code Description
200 (OK) The request was successful, a text message (SMS) has been sent to the admin.
401 (Unauthorized) The request failed because no admin account could be found for the given credentials.
409 (Conflict) The request failed because either the admin has not confirmed her email address and/or mobile number yet or she or her organisation has been disabled.
429 (Too many requests) The request failed because a text message (SMS) has just been sent and the caller needs to wait at least 60 seconds until this endpoint can be called again.

Set a new password

PUT /v<api_version>/admin/password/

This endpoint sets a new password for the calling admin. She must supply either

  • the old password if known, or
  • her email address and the PIN received in the text message (SMS) she received after calling the Request PIN endpoint.

URL parameters

The following parameters are specified as part of the URL, i.e. /<parameter>/:

Name Type Optional For use by Description
api_version String No All admins The Enterprise API version targeted.

PUT data

Parameters are supplied as a JSON object with the following elements:

Name Type Optional For use by Description
email String Yes All admins The admin’s email address.
code String Yes All admins The PIN as received via a text message (SMS).
old_password String Yes All admins The admin’s old password.
new_password String No All admins The admin’s new password.

Result

The following return values indicate the outcome of the API call:

HTTP status code Description
200 (OK) The request was successful, the new password is now active.
400 (Bad request) The request failed because one or more required parameters are missing.
400 (Bad request) The request failed admin password do not match organisation password policy
401 (Unauthorized) The request failed because an invalid email address, PIN and/or old password were provided.
409 (Conflict) The request failed because either the admin has not confirmed her email address and/or mobile number yet or she or her organisation has been disabled.