Exchanges SaaSify user credentials for an opaque bearer token using the OAuth2 resource-owner password grant, or refreshes an existing token with the refresh_token grant. The body is application/x-www-form-urlencoded. There is no client id/secret. Send the optional TenantCode header to select a tenant when the user belongs to more than one. The returned token is valid for 1440 minutes and is sent on every other call as Authorization: Bearer <token>. Do not send the X-SaaSify-Client header from server-to-server integrations (it switches the token into browser cookies).
TenantCode?stringOptional tenant code. Sets the default tenant context for the issued token.
application/x-www-form-urlencoded- body
password?stringSaaSify user password (password grant).
username?stringSaaSify user email (password grant).
grant_type*stringGrant type.
"password""refresh_token"onBehalfOf?stringOptional impersonation claim (username to act on behalf of).
refresh_token?stringA previously issued refresh token (refresh_token grant).
A bearer token. This endpoint returns the raw OAuth token object, not the standard envelope.
application/json- response
OAuth token response from POST /api/token.
userName?stringexpires_in?integerSeconds until expiry (about 1440 minutes).
onBehalfOf?stringtoken_type*stringaccess_token*stringOpaque bearer token.
isTenantUser?stringrefresh_token?stringcurl -X POST 'https://api-demo.saasify.ai/api/token' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -d 'grant_type=refresh_token&refresh_token=N2Q0...opaque'{ "userName": "integration@acme.com", "expires_in": 86399, "onBehalfOf": "", "token_type": "bearer", "access_token": "m5Jb3q...opaque-katana-token", "isTenantUser": "true", "refresh_token": "N2Q0...opaque"}