AUTH APIs

Below you will find all existing AUTH APIs for your project. You can also download them as a postman collection from the API Docs page of your project.

base_url is equal to https://YOUR_PROJECT_ID.api.deskree.com/api/v1/

Sign up with email and password

POST base_url/auth/accounts/signup

Sign up a user with email and password as credentials.

Headers

NameTypeDescription

Content-Type*

String

application/json

Request Body

NameTypeDescription

email*

String

User email

password*

String

User password

{
    "data": {
        "uid": "g16bsf2DN9X3CbGN1osmAjpHlF83",
        "email": "user@example.com",
        "emailVerified": false,
        "disabled": false,
        "idToken": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjUwYTdhYTlkNzg5MmI1MmE4YzgxMzkwMzIzYzVjMjJlMTkwMzI1ZDgiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL3NlY3VyZXRva2VuLmdvb2dsZS5jb20vZGVza3JlZS05ODg4ZDQwYy1jNWUzLTQzMDctOCIsImF1ZCI6ImRlc2tyZWUtOTg4OGQ0MGMtYzVlMy00MzA3LTgiLCJhdXRoX3RpbWUiOjE2NTcyMTI0MjEsInVzZXJfaWQiOiJnMTZic2YyRE45WDNDYkdOMW9zbUFqcEhsRjgzIiwic3ViIjoiZzE2YnNmMkROOVgzQ2JHTjFvc21BanBIbEY4MyIsImlhdCI6MTY1NzIxMjQyMSwiZXhwIjoxNjU3MjE2MDIxLCJlbWFpbCI6InVzZXJAZXhhbXBsZS5jb20iLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsImZpcmViYXNlIjp7ImlkZW50aXRpZXMiOnsiZW1haWwiOlsidXNlckBleGFtcGxlLmNvbSJdfSwic2lnbl9pbl9wcm92aWRlciI6InBhc3N3b3JkIn19.ch20lWIO6c26ZHi3Di1zPdGjfAQkndCKO-L17_lORswI6RY8sLrA8LHdkI1Tk73-fMpQJsEO5I9V_QYRToJ7GTRfc0lvgqCSxsWv8K9SQKg-rMfVKUcI9xASY3ol4ih-ezRXCcC0VtSb501iv161Vppa8fgmVd7qfHfO6efV50-ihPA_H6iGtpw-nejNdbuTAiBRd8VOjQApAeKp0Jr3sTS421u9eIlVPySllj4dyX-d5YReTLTGImN5noTs7yBQpj8rc63-TA3hS7BksSoXyHxcJVuKXS8DxeBJi_hmWTXXRFIfj938wnwMqBevmFzVbVTdpyjyP4RL0cISRXikBQ",
        "refreshToken": "AIwUaOn0QXtzI0f_DbKca7QfoHnKhSlswIHoOuL5Hsrg-UGePN5aQID6giYWkvyMlLCk-67pVxNXC5yvoMuvhsTLab6FkSaCM2zK4vwxWplCAjMuTI_Ux7CVl3tTSexEjGd6NZQuNeKHYlI8zWPBLW4bvGtJ1Tc6NwpvIKRAi_ZNDl9Zcir0UDQQp_LPTuQu58F2ZIetfeG_oZB5rDbmo3F7uKOtsDihtywnZYHZm1C7E-Qp7GEWBc8",
        "expiresIn": "3600"
    }
}

Sign in with email and password

POST base_url/auth/accounts/sign-in/email

Sign in the user with email and password as credentials.

Headers

NameTypeDescription

Content-Type*

String

application/json

Request Body

NameTypeDescription

email*

String

User email

password*

String

User password

{
    "data": {
        "uid": "g16bsf2DN9X3CbGN1osmAjpHlF83",
        "email": "user@example.com",
        "emailVerified": false,
        "disabled": false,
        "idToken": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjUwYTdhYTlkNzg5MmI1MmE4YzgxMzkwMzIzYzVjMjJlMTkwMzI1ZDgiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL3NlY3VyZXRva2VuLmdvb2dsZS5jb20vZGVza3JlZS05ODg4ZDQwYy1jNWUzLTQzMDctOCIsImF1ZCI6ImRlc2tyZWUtOTg4OGQ0MGMtYzVlMy00MzA3LTgiLCJhdXRoX3RpbWUiOjE2NTcyMTI0MjEsInVzZXJfaWQiOiJnMTZic2YyRE45WDNDYkdOMW9zbUFqcEhsRjgzIiwic3ViIjoiZzE2YnNmMkROOVgzQ2JHTjFvc21BanBIbEY4MyIsImlhdCI6MTY1NzIxMjQyMSwiZXhwIjoxNjU3MjE2MDIxLCJlbWFpbCI6InVzZXJAZXhhbXBsZS5jb20iLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsImZpcmViYXNlIjp7ImlkZW50aXRpZXMiOnsiZW1haWwiOlsidXNlckBleGFtcGxlLmNvbSJdfSwic2lnbl9pbl9wcm92aWRlciI6InBhc3N3b3JkIn19.ch20lWIO6c26ZHi3Di1zPdGjfAQkndCKO-L17_lORswI6RY8sLrA8LHdkI1Tk73-fMpQJsEO5I9V_QYRToJ7GTRfc0lvgqCSxsWv8K9SQKg-rMfVKUcI9xASY3ol4ih-ezRXCcC0VtSb501iv161Vppa8fgmVd7qfHfO6efV50-ihPA_H6iGtpw-nejNdbuTAiBRd8VOjQApAeKp0Jr3sTS421u9eIlVPySllj4dyX-d5YReTLTGImN5noTs7yBQpj8rc63-TA3hS7BksSoXyHxcJVuKXS8DxeBJi_hmWTXXRFIfj938wnwMqBevmFzVbVTdpyjyP4RL0cISRXikBQ",
        "refreshToken": "AIwUaOn0QXtzI0f_DbKca7QfoHnKhSlswIHoOuL5Hsrg-UGePN5aQID6giYWkvyMlLCk-67pVxNXC5yvoMuvhsTLab6FkSaCM2zK4vwxWplCAjMuTI_Ux7CVl3tTSexEjGd6NZQuNeKHYlI8zWPBLW4bvGtJ1Tc6NwpvIKRAi_ZNDl9Zcir0UDQQp_LPTuQu58F2ZIetfeG_oZB5rDbmo3F7uKOtsDihtywnZYHZm1C7E-Qp7GEWBc8",
        "expiresIn": "3600"
    }
}

Create URL for OAuth sign in

POST base_url/auth/accounts/sign-in/auth-url

Creates URL for the user to sign in using OAuth

Headers

NameTypeDescription

Content-Type*

String

application/json

Request Body

NameTypeDescription

providerId*

String

google.com, facebook.com, or github.com

callBackUri*

String

URL where the request will be redirected to after successful OAUTH sign-in. Note: for most OAUTH providers the redirect URL must be specified in the app settings. Examples: Google, Facebook, GitHub

{
    "data": {
        "authUri": "https://accounts.google.com/o/oauth2/auth?response_type=id_token&client_id=623213283749-0o0tto76nqu3ikn3as8eocdk41aag5tb.apps.googleusercontent.com&redirect_uri=http://localhost&state=AMbdmDlwnf12GgLWzl8ITv-AFHeyVLAiqXzE_9goszlPjO0QhOR8iTn5I6ZtdGNYCBCwhyJhI1diEoZgyDk7peY16selAeq4vmcDf2qClOt7ns_WqU1Gc07Cuymkyfqz60zFRhSHU1S_YumikZahR1nmv6WxQoxJyRlSyjYHY39G-fSCZN7itE9tA3WNO1j24TP9_t6hKFRfcc-8NYIbqRhitPOFjmUemtWUueWqUDDN5kv3b4fgnq5-elwRrDtQ74TX9v05Q8_AK4bDODVMOget-A&scope=openid+https://www.googleapis.com/auth/userinfo.email&nonce=b0fd25ce8f554880e9000d1bce463efeeeaa1f65332bf036bd3db3cef3c07400&include_profile=true",
        "providerId": "google.com",
        "sessionId": "Y31RHgVt30cTUZfbh3KYVTJbUT0"
    }
}

Sign in with a selected OAuth provider

POST base_url/auth/accounts/sign-in/email

Sign in the user with the selected OAuth provider

Headers

NameTypeDescription

Content-Type*

String

application/json

Request Body

NameTypeDescription

token

String

Used only for Google and Facebook sign-in.

If the token is provided, code parameter is ignored.

The parameter will be returned in the callBackUri of createUrlForOAuthSignIn() after a successful OAUTH sign-in.

code

String

The parameter will be returned in the callBackUri of createUrlForOAuthSignIn() after a successful OAUTH sign-in.

callBackUri*

String

URL to redirect users after a successful OAUTH sign-in.

sessionId*

String

The ID of the OAUTH session returned from Create URL for OAuth sign in

providerId*

String

google.com, facebook.com, or github.com

{
    "data": {
        "providerId": "google.com",
        "localId": "a9nsiasjdi1d9wd1dwm9w1wd",
        "emailVerified": true,
        "email": "example@example.org",
        "rawUserInfo": "",
        "firstName": "Johnathan",
        "lastName": "Doe",
        "fullName": "Johnathan Doe",
        "displayName": "John Doe",
        "photoUrl": ""
        "idToken": "eyJahbGciOiJSUzI1NiIsImtpZCI6IjUwYTdhYTlkNzg5MmI1MmE4YzgxMzkwMzIzYzVjMjJlMTkwMzI1ZDgiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL3NlY3VyZXRva2VuLmdvb2dsZS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1C7E-Qp7GEWBc8",
        "expiresIn": "3600",
        "needConfirmation": true
    }
}

Invite user

POST base_url/auth/accounts/invite

Send an invite to a user via email. The system will first create a user in a disabled state until the invite is accepted via a link to be sent to the provided email.

Headers

NameTypeDescription

Content-Type*

String

application/json

Request Body

NameTypeDescription

email*

String

User email

{
    "errors": [
        {
            "code": "422",
            "title": "Unprocessable Entity",
            "detail": "The email address is already in use by another account."
        }
    ]
}

Verify invite

POST base_url/auth/accounts/verify/invite

Endpoint to verify invitation based on oobCode and uid provided in the email sent to the user. The oobCode and uid are found in the password reset URL. Password reset URL has the following structure: {email_conf_url}?oobCode={oobCode}&uid={uid}.

Headers

NameTypeDescription

Content-Type*

String

application/json

Request Body

NameTypeDescription

oobCode*

String

Can be found in the URL sent to the user by the Invite usermethod

uid*

String

User UID

newPassword*

String

Password set by the invited user

{
    "errors": [
        {
            "code": "422",
            "title": "Unprocessable Entity",
            "detail": "No newPassword, uid, or oobCode provided"
        }
    ]
}

Reset password

POST base_url/auth/accounts/password-reset

Endpoint to reset the user password. The user will receive an email prompting him to change the existing password by following a URL. Note that you need to have a reset password URL specified in authentication settings in order for this endpoint to work.

Headers

NameTypeDescription

Content-Type*

String

application/json

Request Body

NameTypeDescription

email*

String

User email

{
    "errors": [
        {
            "code": "422",
            "title": "Unprocessable Entity",
            "detail": "No email address provided"
        }
    ]
}

Verify password reset

POST base_url/auth/accounts/verify/password-reset

Endpoint to verify password reset request based on oobCode provided in the email sent to the user. The oobCode can be found in the password reset URL. Password reset URL has the following structure: {email_conf_url}?oobCode={oobCode}

Headers

NameTypeDescription

Content-Type*

String

application/json

Request Body

NameTypeDescription

oobCode*

String

Can be found in the URL sent to the user by the Reset password method.

newPassword*

String

New password for the user

{
    "errors": [
        {
            "code": "400",
            "title": "Bad Request",
            "detail": "INVALID_OOB_CODE"
        }
    ]
}

Verify email

POST base_url/auth/accounts/verify/email

Endpoint to verify the email based on oobCode and uid provided in the email sent to the user. The oobCode and uid are found in the email verification URL. Email verification URL has the following structure: {email_conf_url}?oobCode={oobCode}&uid={uid}.

Headers

NameTypeDescription

Content-Type*

String

application/json

Request Body

NameTypeDescription

email*

String

User email

{
    "errors": [
        {
            "code": "422",
            "title": "Unprocessable Entity",
            "detail": "There is no user record corresponding to the provided identifier."
        }
    ]
}

Update email

POST base_url/auth/accounts/update-email

Update the user email.

Headers

NameTypeDescription

Content-Type*

String

application/json

authorization*

String

a valid idToken of the registered user

Request Body

NameTypeDescription

email*

String

User email

{
    "errors": [
        {
            "code": "422",
            "title": "Unprocessable Entity",
            "detail": "Please provide a valid email and password"
        }
    ]
}

Fetch email providers

POST base_url/auth/accounts/signup

Get a list of authentication providers for the given email.

Headers

NameTypeDescription

Content-Type*

String

application/json

Request Body

NameTypeDescription

email*

String

User email

{
    "data": {
        "allProviders": [
            "password"
        ],
        "registered": true,
    }
}

Exchange refreshToken for idToken

POST base_url/auth/accounts/token/refresh

Exchange refreshToken for idToken

Headers

NameTypeDescription

Content-Type*

String

application/json

Request Body

NameTypeDescription

refresh_token*

String

Refresh token obtained from any sign-up or sign-in methods

{
    "data": {
        "expires_in": "3600",
        "refresh_token": "AOEOulbFrpu25a7BwDxFzjPp67kenvwi3N7kJnXx6pCBaFMDWcBeHTTu1N_t6IGwxFm8lB44h2t2RD96Xcw2iMgvfMZCzkp8o6UJrCjjDQGjXOcO7u-wU5C3rZxUk5QvhWEvnxOpdIVJ5V7FRefWKfUzYVraIvgvTo3WnpbJ9Czx5IbadvknQxzfMt7OjCH7RfGrwEmA47huc-aoE2XZfLTOqRsfApKiHfaKAQtxNAie904p1lZEuMT2Ntss8fxTg61BrYvYO_XQr",
        "id_token": "eyJahbGciOiJSUzI1NiIsImtpZCI6IjUwYTdhYTlkNzg5MmI1MmE4YzgxMzkwMzIzYzVjMjJlMTkwMzI1ZDgiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL3NlY3VyZXRva2VuLmdvb2dsZS5jb20vZGVza3JlZS1mYzY3ODUyYy1jYTRlLTQ4MTQtYSIsImF1ZCI6ImRlc2tyZWUtZmM2Nzg1MmMtY2E0ZS00ODE0LWEiLCJhdXRoX3RpbWUiOjE2NTc1NTc2MzEsInVzZXJfaWQiOiJpOVhVWEo1QXJEUFlHeTkwc0VYdU5LVWliaEczIiwic3ViIjoiaTlYVVhKNUFyRFBZR3k5MHNFWHVOS1VpYmhHMyIsImlhdCI6MTY1NzU2NzA3MiwiZXhwIjoxNjU3NTcwNjcyLCJlbWFpbCI6ImJpbWV4aXM0NjNAbGV1cHVzLmNvbSIsImVtYWlsX3ZlcmlmaWVkIjpmYWxzZSwiZmlyZWJhc2UiOnsiaWRlbnRpdGllcyI6eyJlbWFpbCI6WyJiaW1leGlzNDYzQGxldXB1cy5jb20iXX0sInNpZ25faW5fcHJvdmlkZXIiOiJwYXNzd29yZCJ9fQ.noxnUOenJmxaGbm9gKq_tZQoWAPwvRDEKpxHJ3gLfd-mzWWs3AqHXlqYvtV7jtlJDIuHisTk5MQeugRiUjVaN0RHuraFMO9gSpuv4-7roIjVRpp7GoFPHRjdzge8WMBM-obtsDC-D1QhjvCXqXcvmbcFS2ej1zbHDvANncOQckXxGdT0dFHIiZGWmUqMnUxKpWuiYhsci7Odf7TWiKUPFuGrzCBV2QbA8veAklNdIAHmbAvwFFnJtl8A4FsOYbwpmr-TB3RFBWBo1SzZUzyzLb4ffbV4k5Monkp3i1mqRphByLiynrkKohPa0sLun2jjbXRHK6iPQOKPYaFNHaxbDQ",
        "user_id": "i9XsUXJ5ArDPYGy90sEXuNKUibhG3"
    }
}

Delete account

DELETE base_url/auth/accounts/

Delete the account based on the Bearer token. The system will also delete the corresponding user object inside the Users table.

Headers

NameTypeDescription

Content-Type*

String

application/json

authorization*

String

a valid idToken of the registered user

{
    "errors": [
        {
            "code": "500",
            "title": "Internal Server Error",
            "detail": "Error processing your request"
        }
    ]
}

Get roles

GET base_url/auth/accounts/roles

Delete the account based on the Bearer token. The system will also delete the corresponding user object inside the Users table.

Headers

NameTypeDescription

Content-Type*

String

application/json

deskree-admin*

String

{
    "data": [
        {
            "uid": "njiasd91n2mkoaskmoadsko",
            "name": "admin"
        }
    ]
}

Last updated

Copyright © 2023 Deskree Technologies Inc.