Back to top

API Documentation

Authorize

Overview

We currently allow applications to authenticate with OAuth 2 protocol. OAuth2 has different strategies and Rechat supports two of them:

Strategy Use case
Bearer (AccessToken) User login required
ClientPassword User login makes no sense in the context (eg Registration, where user has no credentials to begin with)

The ClientPassword authentication method is only reserved for for Rechat’s internal applications. Partners trying to create integrations should use OAuth process to fetch new tokens.

You should use a third party library for handling the whole process.

If you are writing code to handle these steps, you are most probably doing it wrong.

Authentication

Get Token
POST/oauth2/token

Basically, login in rechat (and other oauth2 based API’s) means fetching access_token from the server and providing it in the HTTP headers for the remainder of the session like this:

Authorization: Bearer <fetched_access_token>

Additional to access_token, this endpoint will give you:

  • Profile of the logged in user.

  • Expirey date of the access token

  • A refresh token

Example URI

POST /oauth2/token
Request
HideShow
Body
{
  "client_id": "bf0da47e-7226-11e4-905b-0024d71b10fc",
  "client_secret": "secret",
  "username": "[email protected]",
  "password": "aaaaaa",
  "grant_type": "password"
}
Response  200
HideShow
Body
{
  "access_token": "OWM2ZWJjNDYtYTkzMy0xMWYwLTk0MDMtZjZiYzdmNzkwNjNi",
  "refresh_token": "OWM2ZGRlNDgtYTkzMy0xMWYwLTk0MDMtZjZiYzdmNzkwNjNi",
  "expires_in": 2678400,
  "code": "OK",
  "data": {
    "type": "user",
    "username": null,
    "first_name": "Unit",
    "last_name": "Test",
    "email": "[email protected]",
    "phone_number": "+4368120265807",
    "created_at": 1493115498.770362,
    "id": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
    "address_id": null,
    "cover_image_url": null,
    "profile_image_url": null,
    "updated_at": 1493115498.770744,
    "user_status": "Active",
    "profile_image_thumbnail_url": null,
    "cover_image_thumbnail_url": null,
    "email_confirmed": true,
    "timezone": "America/Chicago",
    "user_type": "Admin",
    "deleted_at": null,
    "phone_confirmed": false,
    "is_shadow": false,
    "personal_room": null,
    "brand": null,
    "fake_email": false,
    "features": [
      "Deals"
    ],
    "last_seen_at": null,
    "email_signature": null,
    "daily_enabled": false,
    "email_quota": 30000,
    "website": null,
    "instagram": null,
    "twitter": null,
    "linkedin": null,
    "youtube": null,
    "facebook": null,
    "designation": null,
    "tiktok": null,
    "mfa_enabled": false,
    "xpressdocs_user_id": null,
    "current_time": "2:25 PM - Tuesday Oct 14, 2025",
    "push_allowed": true,
    "agents": null,
    "last_seen_type": null,
    "active_brand": null,
    "display_name": "Unit Test",
    "abbreviated_display_name": "Unit",
    "online_state": "Offline",
    "has_password": true
  },
  "token_type": "Bearer"
}

Refresh Token
POST/oauth2/token

An access token has a expiry date and thus will be expired. But every time you get an access token (as documented above), you will be given a refresh token which has a longer expiry.

At any time, you can exchange the refresh token with a new pair of tokens like this:

Example URI

POST /oauth2/token
Request
HideShow
Body
{
  "refresh_token": "OWM2ZGRlNDgtYTkzMy0xMWYwLTk0MDMtZjZiYzdmNzkwNjNi",
  "grant_type": "refresh_token",
  "client_id": "bf0da47e-7226-11e4-905b-0024d71b10fc",
  "client_secret": "secret"
}
Response  200
HideShow
Body
{
  "access_token": "OWM3MzU1NTgtYTkzMy0xMWYwLTk0MDMtZjZiYzdmNzkwNjNi",
  "refresh_token": "OWM3MmQ2YzgtYTkzMy0xMWYwLTk0MDMtZjZiYzdmNzkwNjNi",
  "expires_in": 2678400,
  "code": "OK",
  "token_type": "Bearer"
}

Multi-factor authentication

Overview

MFA is an opt-in feature, allowing users to set it up in their account settings. Once MFA is activated, MFA will be required when making certain API requests, such as changing the password.

  • Setup MFA: To get started, make a POST request to /users/self/mfa/setup. This endpoint will return two important fields, mfa_url and mfa_qr_code, which can be used with an authenticator application to add a new service.

  • Verify MFA: POST /users/self/mfa/verify After setting up MFA, it’s not immediately enabled for the user. We require users to verify it first by providing a token. The verification step enables the MFA for the user and also marks the current access_token/refresh_token pair as MFA validated.

  • Validate MFA: If a user with verified MFA needs to sign in again, the new access_token/refresh_token pair won’t be MFA validated by default. This means that every request made with the access token will result in a 401 MFA required error. In such cases, the client must call POST /users/self/mfa/validate with a valid MFA token generated by the authenticator application to mark the tokens as MFA validated.

  • Delete MFA: DELETE /users/self/mfa endpoint with a valid MFA token can be used to remove the multi-factor authentication from the user.

Setup MFA

Setup MFA
POST/users/self/mfa/setup

Example URI

POST /users/self/mfa/setup
Response  200
HideShow
Body
{
  "code": "OK",
  "data": {
    "type": "user",
    "username": null,
    "first_name": "updated first name",
    "last_name": "Test",
    "email": "[email protected]",
    "phone_number": "+4368120265807",
    "created_at": 1493115498.770362,
    "id": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
    "address_id": null,
    "cover_image_url": "https://test.cloudfront.net/80a227b2-29a0-11e7-b636-e4a7a08e15d4/0c9106f0-a934-11f0-bdea-d5cf17ea076e.jpg",
    "profile_image_url": "https://test.cloudfront.net/80a227b2-29a0-11e7-b636-e4a7a08e15d4/0c974880-a934-11f0-bdea-d5cf17ea076e.jpg",
    "updated_at": 1760470146.322939,
    "user_status": "Active",
    "profile_image_thumbnail_url": null,
    "cover_image_thumbnail_url": null,
    "email_confirmed": true,
    "timezone": "America/Chicago",
    "user_type": "Agent",
    "deleted_at": null,
    "phone_confirmed": true,
    "is_shadow": false,
    "personal_room": null,
    "brand": null,
    "fake_email": false,
    "features": [
      "Deals"
    ],
    "last_seen_at": null,
    "email_signature": "Here is my great signature",
    "daily_enabled": true,
    "email_quota": 30000,
    "website": null,
    "instagram": null,
    "twitter": null,
    "linkedin": null,
    "youtube": null,
    "facebook": null,
    "designation": null,
    "tiktok": null,
    "mfa_enabled": false,
    "xpressdocs_user_id": null,
    "current_time": "2:29 PM - Tuesday Oct 14, 2025",
    "push_allowed": true,
    "agents": [
      {
        "id": "bf43bcd1-7576-4053-b032-41c9cd97cc18",
        "email": "[email protected]",
        "mlsid": "00920130",
        "fax": "(972) 264-4703",
        "full_name": "Gholi Sweet",
        "first_name": "Gholi",
        "last_name": "Sweet",
        "middle_name": null,
        "phone_number": "(972) 264-4703",
        "nar_number": "797500044",
        "office_mui": "15512742",
        "status": "Active",
        "office_mlsid": "RCHT01X",
        "work_phone": "(469) 358-8080",
        "generational_name": null,
        "matrix_unique_id": "155155530",
        "updated_at": 1760470144.218945,
        "deleted_at": null,
        "created_at": 1760470144.218945,
        "mls": "NTREIS",
        "license_number": null,
        "designation": null,
        "nrds": "01053140",
        "type": "agent",
        "office_id": null,
        "secret_questions": [
          "(972) XXX-XX03",
          "jewellxxxxxxxxxxxxxal.net",
          "(469) XXX-XX80"
        ]
      }
    ],
    "last_seen_type": null,
    "active_brand": null,
    "display_name": "updated first name Test",
    "abbreviated_display_name": "updated first name",
    "online_state": "Offline",
    "mfa_url": "otpauth://totp/Rechat:test%40rechat.com?issuer=Rechat&secret=7E6FWABNGON222FZPIDD756R6MMLRXIL&algorithm=SHA1&digits=6&period=30",
    "mfa_qr_code": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANQAAADUCAYAAADk3g0YAAAAAklEQVR4AewaftIAAApxSURBVO3BQY4gx7LgQDJR978yp3ffVwEkMqqlp3Ez+4O11hUPa61rHtZa1zysta55WGtd87DWuuZhrXXNw1rrmoe11jUPa61rHtZa1zysta55WGtd87DWuuZhrXXNw1rrmh8+UvmbKk5UpopJZaqYVN6omFSmikllqphUpopJZaqYVE4qJpWpYlKZKk5UpooTlaliUvmbKr54WGtd87DWuuZhrXXND5dV3KTyRsWkMlWcVLyhMlVMKm9UTConKlPFpHJScVJxk8pU8UbFTSo3Pay1rnlYa13zsNa65odfpvJGxRsqX6hMFZPKVHGiMlVMKm9UTCpfqPymir9J5Y2K3/Sw1rrmYa11zcNa65of/uMqJpUTlanipOILld9U8YbKScWkMqlMFScqU8X/soe11jUPa61rHtZa1/zwH6dyk8pUMalMFVPFpPJPUvmiYlKZVP5/8rDWuuZhrXXNw1rrmh9+WcU/qWJSmSomlZOKSWWqmFSmipOKN1QmlTcqJpWpYlKZKqaKv6ni3+RhrXXNw1rrmoe11jU/XKbyT6qYVKaKSWWqmFSmir9JZao4qZhUpopJZaqYVKaKSWWqmFSmikllqjhR+Td7WGtd87DWuuZhrXXNDx9V/JtVTCpvVE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KZKiaVk4o3VKaKSeWLiknlN1W8oXJSMam8UTGp/KaKSeWk4ouHtdY1D2utax7WWtf88FHFGxVvVPybVEwqU8WkMqmcVLyhMlWcqNxUMalMFW9UvKEyVUwqU8WkctPDWuuah7XWNQ9rrWt++Ejlb6qYKk5UporfpHKTylRxovJGxaRyojJVTBWTylTxhspU8YXKVHHTw1rrmoe11jUPa61rfris4iaVE5Wp4kTlpGJSmSqmihOVLyreqJhUTlSmiknlRGWqmCq+qHhD5aRiUpkqvnhYa13zsNa65mGtdc0Pv0zljYrfVDGpnFScqEwVJxWTyqTymyq+qDhRmSomlROVLyreqLjpYa11zcNa65qHtdY1P/zHVdykMlVMKicqv0llqvii4kRlqjipuEnlROWNii8e1lrXPKy1rnlYa13zw3+MyknFTSpTxT9JZVKZKk5U3qiYVE4qJpWbVE4qftPDWuuah7XWNQ9rrWt++GUVv6liUpkqJpU3VE4qJpWp4kRlqrip4ouKSWVSOal4o+INlX+Th7XWNQ9rrWse1lrX/HCZyt+kcqIyVUwqN1W8UTGpTBUnKlPFicpJxRsVJypfqJxUTCpTxaQyVdz0sNa65mGtdc3DWusa+4O11hUPa61rHtZa1zysta55WGtd87DWuuZhrXXNw1rrmoe11jUPa61rHtZa1zysta55WGtd87DWuuZhrXXNw1rrmv8Hqfi4n5A//TsAAAAASUVORK5CYII=",
    "has_password": true
  }
}

Verify MFA after setup

Verify MFA after setup
POST/users/self/mfa/verify

Example URI

POST /users/self/mfa/verify
Request
HideShow
Body
{
  "token": "904334"
}
Response  200
HideShow
Body
{
  "code": "OK",
  "data": {
    "type": "user",
    "username": null,
    "first_name": "updated first name",
    "last_name": "Test",
    "email": "[email protected]",
    "phone_number": "+4368120265807",
    "created_at": 1493115498.770362,
    "id": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
    "address_id": null,
    "cover_image_url": "https://test.cloudfront.net/80a227b2-29a0-11e7-b636-e4a7a08e15d4/0c9106f0-a934-11f0-bdea-d5cf17ea076e.jpg",
    "profile_image_url": "https://test.cloudfront.net/80a227b2-29a0-11e7-b636-e4a7a08e15d4/0c974880-a934-11f0-bdea-d5cf17ea076e.jpg",
    "updated_at": 1760470146.322939,
    "user_status": "Active",
    "profile_image_thumbnail_url": null,
    "cover_image_thumbnail_url": null,
    "email_confirmed": true,
    "timezone": "America/Chicago",
    "user_type": "Agent",
    "deleted_at": null,
    "phone_confirmed": true,
    "is_shadow": false,
    "personal_room": null,
    "brand": null,
    "fake_email": false,
    "features": [
      "Deals"
    ],
    "last_seen_at": null,
    "email_signature": "Here is my great signature",
    "daily_enabled": true,
    "email_quota": 30000,
    "website": null,
    "instagram": null,
    "twitter": null,
    "linkedin": null,
    "youtube": null,
    "facebook": null,
    "designation": null,
    "tiktok": null,
    "mfa_enabled": true,
    "xpressdocs_user_id": null,
    "current_time": "2:29 PM - Tuesday Oct 14, 2025",
    "push_allowed": true,
    "agents": [
      {
        "id": "bf43bcd1-7576-4053-b032-41c9cd97cc18",
        "email": "[email protected]",
        "mlsid": "00920130",
        "fax": "(972) 264-4703",
        "full_name": "Gholi Sweet",
        "first_name": "Gholi",
        "last_name": "Sweet",
        "middle_name": null,
        "phone_number": "(972) 264-4703",
        "nar_number": "797500044",
        "office_mui": "15512742",
        "status": "Active",
        "office_mlsid": "RCHT01X",
        "work_phone": "(469) 358-8080",
        "generational_name": null,
        "matrix_unique_id": "155155530",
        "updated_at": 1760470144.218945,
        "deleted_at": null,
        "created_at": 1760470144.218945,
        "mls": "NTREIS",
        "license_number": null,
        "designation": null,
        "nrds": "01053140",
        "type": "agent",
        "office_id": null,
        "secret_questions": [
          "(972) XXX-XX03",
          "jewellxxxxxxxxxxxxxal.net",
          "(469) XXX-XX80"
        ]
      }
    ],
    "last_seen_type": null,
    "active_brand": null,
    "display_name": "updated first name Test",
    "abbreviated_display_name": "updated first name",
    "online_state": "Offline",
    "has_password": true
  }
}

Validate an MFA token

Validate an MFA token
POST/users/self/mfa/validate

Example URI

POST /users/self/mfa/validate
Request
HideShow
Body
{
  "token": "904334"
}
Response  204

Remove MFA

Remove MFA
DELETE/users/self/mfa

Example URI

DELETE /users/self/mfa
Request
HideShow
Body
{
  "token": "904334"
}
Response  204

Generated by aglio on 14 Oct 2025