OAuth2
OAuth2 authentication and authorization flows.
Query parameters
utm_locationstringOptionalExample:
lesHeader parameters
authorizationstringOptional
OAuth 2.0 Client Application - Basic Auth required for grant_type=authorization_code requests.
Body
grant_typestring · enumRequiredPossible values:
usernamestringWrite-onlyOptional
passwordstringWrite-onlyOptional
scopestringWrite-onlyOptional
refresh_tokenstringWrite-onlyOptional
codestringWrite-onlyOptional
redirect_uristringWrite-onlyOptional
client_idstringWrite-onlyOptional
client_secretstringWrite-onlyOptional
Responses
201
Returns a OAuth2AccessToken
application/json
access_tokenstringRead-onlyRequired
token_typestring · enumRead-onlyRequiredPossible values:
expires_innumberRead-onlyRequired
refresh_tokenstringRead-onlyRequired
scopestringRead-onlyOptional
422
Returns a OAuth2AccessTokenError
application/json
post/oauth2/token
POST /apis/v2/oauth2/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 177
"grant_type='password'&username='text'&password='text'&scope='text'&refresh_token='text'&code='text'&redirect_uri='text'&client_id='text'&client_secret='text'"{
"access_token": "text",
"token_type": "bearer",
"expires_in": 1,
"refresh_token": "text",
"scope": "text"
}Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
usernamestringRequired
grant_typestring · enumRequiredPossible values:
Responses
201
Returns a OAuth2AccessToken
application/json
access_tokenstringRead-onlyRequired
token_typestring · enumRead-onlyRequiredPossible values:
expires_innumberRead-onlyRequired
refresh_tokenstringRead-onlyRequired
scopestringRead-onlyOptional
post/oauth2/webview-token
POST /apis/v2/oauth2/webview-token HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 54
{
"username": "text",
"grant_type": "mobile_webview_auth"
}201
Returns a OAuth2AccessToken
{
"access_token": "text",
"token_type": "bearer",
"expires_in": 1,
"refresh_token": "text",
"scope": "text"
}post
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
typestring · enumRequiredPossible values:
ssostringRequired
sigstringRequired
callbackUrlstringRead-onlyRequired
Responses
201
Returns a SSOAuthorizationDiscourseConnect
application/json
typestring · enumRequiredPossible values:
ssostringRequired
sigstringRequired
callbackUrlstringRead-onlyRequired
post/oauth2/discourse-connect/authorizations
POST /apis/v2/oauth2/discourse-connect/authorizations HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 54
{
"type": "DISCOURSE_CONNECT",
"sso": "text",
"sig": "text"
}201
Returns a SSOAuthorizationDiscourseConnect
{
"type": "DISCOURSE_CONNECT",
"sso": "text",
"sig": "text",
"callbackUrl": "text"
}post
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
typestring · enumRequiredPossible values:
clientIdstringRequired
redirectUristringWrite-onlyRequired
scopestringOptional
codestringRead-onlyRequired
callbackUrlstringRead-onlyRequired
Responses
201
Returns a SSOAuthorizationOauth2AuthorizationCode
application/json
typestring · enumRequiredPossible values:
clientIdstringRequired
redirectUristringWrite-onlyRequired
scopestringOptional
codestringRead-onlyRequired
callbackUrlstringRead-onlyRequired
post/oauth2/authorizations
POST /apis/v2/oauth2/authorizations HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 90
{
"type": "OAUTH2_AUTHORIZATION_CODE",
"clientId": "text",
"redirectUri": "text",
"scope": "text"
}201
Returns a SSOAuthorizationOauth2AuthorizationCode
{
"type": "OAUTH2_AUTHORIZATION_CODE",
"clientId": "text",
"scope": "text",
"code": "text",
"callbackUrl": "text"
}Body
emailstring · emailWrite-onlyRequired
Responses
200
Returns a UserCredentialsPatchable
application/json
emailstring · emailWrite-onlyRequired
patch/oauth2/users/credentials
PATCH /apis/v2/oauth2/users/credentials HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 26
{
"email": "name@gmail.com"
}200
Returns a UserCredentialsPatchable
{}Last updated
Was this helpful?

