Authentication Documentation

Use your account credentials (username in lowercase) and tokens to manage your account programmatically. Access tokens expire after 24 hours, while Refresh tokens expire after 90 days. Use the login endpoint to receive your tokens, then use token-refresh and token-revoke endpoints to manage them. Your account password can also be managed with the associated endpoints referenced in this document.

Refresh Token

POST https://auth.enterprise.wikimedia.com/v1/token-refresh

Provides new access and id tokens with your valid username and refresh token.

Request Body Required
username
string
refresh_token
string
application/json
{ "username": "admin", "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9" }
Response
  • application/json
    { "id_token": "string", "access_token": "string", "expires_in": 300 }
  • application/json
    { "message": "string", "status": "integer" }
  • application/json
    { "message": "string", "status": "integer" }
  • application/json
    { "message": "string", "status": "integer" }

Revoke Token

POST https://auth.enterprise.wikimedia.com/v1/token-revoke

Revokes the associated access tokens with your valid refresh token.

Request Body Required
refresh_token
string
application/json
{ "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9" }
Response
  • application/json
    { "message": "string", "status": "integer" }
  • application/json
    { "message": "string", "status": "integer" }

Forgot Password

POST https://auth.enterprise.wikimedia.com/v1/forgot-password

Sends a confirmation code via email. That code is then required to change user's password using /v1/forgot-password-confirm.

Request Body Required
username
string
application/json
{ "username": "admin" }
Response
  • application/json
    { "message": "string", "status": "integer" }
  • application/json
    { "message": "string", "status": "integer" }
  • application/json
    { "message": "string", "status": "integer" }

Forgot Password Confirmation

POST https://auth.enterprise.wikimedia.com/v1/forgot-password-confirm

Changes user password with your valid username, confirmation_code sent to your email from previously hitting /v1/forgot-password endpoint, and new password.

Request Body Required
username
string
password
string
confirmation_code
string
application/json
{ "username": "admin", "password": "j8BDWYrQwDF5u4Yu", "confirmation_code": "6MadrbRF" }
Response
  • application/json
    { "message": "string", "status": "integer" }
  • application/json
    { "message": "string", "status": "integer" }
  • application/json
    { "message": "string", "status": "integer" }

Change Password

POST https://auth.enterprise.wikimedia.com/v1/change-password

Changes user password with your valid access token, current password, and a new proposed password.

Request Body Required
access_token
string
previous_password
string
proposed_password
string
application/json
{ "access_token": "sInR5cCI6IkpXVCJ9eyJhbGciOiJIUzI1NiI", "previous_password": "j8BDWYrQwDF5u4Yu", "proposed_password": "b2BDWZrQwDF5u4Yu" }
Response
  • application/json
    { "message": "string", "status": "integer" }
  • application/json
    { "message": "string", "status": "integer" }
  • application/json
    { "message": "string", "status": "integer" }

New Password Required

POST https://auth.enterprise.wikimedia.com/v1/new-password-required

Responds NEW_PASSWORD_REQUIRED challenge by receiving username and session token and setting new password.

Request Body Required
session
string
username
string
new_password
string
application/json
{ "session": "eyJhbGcisInR5cCI6IkOiJIUzI1NiIpXVCJ9", "username": "admin", "new_password": "b2BDWZrQwDF5u4Yu" }
Response
  • application/json
    { "id_token": "string", "access_token": "string", "refresh_token": "string", "session": "string", "expires_in": 300 }
  • application/json
    { "message": "string", "status": "integer" }
  • application/json
    { "message": "string", "status": "integer" }
  • application/json
    { "message": "string", "status": "integer" }