Obtaining Authorization Tokens

Host Authorization Token

POST /hosts/auth

Obtain the authentication header

Headers

Name

Value

Content-Type

application/json

Origin

SITE_URL

  • SITE_URL - The Authorized Site URL

This is the only request that does not require the Host Authorization Header for obvious reasons :smile:

Body

Name

Type

Description

client_id

string

CLIENT_ID provided by Annoto for SITE_URL

origin

string

The Authorized SITE_URL

session_id

string

random string for identifying the visitor SESSION_ID

visitor_id

string

random string for identifying the site VISITOR_ID

{
"client_id": "CLIENT_ID"
"origin": "SITE_URL"
"session_id": "SESSION_ID",
"visitor_id": "VISITOR_ID"
}

Response

200
{
"host_token": "HOST_JWT_AUTHORIZATION_TOKEN",
"settings": {
"enableSSO": true,
"publicName": "OPTIONAL_PUBLIC_NAME_OF_THE_SITE",
},
"name": "NAME_OF_THE_SITE"
}
400
{
"message": "Bad request",
"statusCode": 400
}
401
{
"message": "Unauthorized",
"statusCode": 401
}
  • HOST_JWT_AUTHORIZATION_TOKEN - The JWT token to be used in Host Authorization Header

User Authorization Token via SSO

POST /auth/sso

Annoto supports various authentication strategies for users, eventually all the strategies yield the user authorization JWT token to be used by the APIs, this API is for SSO strategy.

Headers

Name

Value

Content-Type

application/json

Host-Authorization

Bearer <token>

  • <token> - The HOST_JWT_AUTHORIZATION_TOKEN

Body

Name

Type

Description

token

string

the generated user SSO Token according to
SSO (Single Sign On)

{
"token": "USER_SSO_JWT_TOKEN"
}

Hints for generating the USER_SSO_JWT_TOKEN

  • For scope use appropriate scope based on the permission requirements of the APIs to be used. For most APIs super-mod scope would be sufficient.

  • For name we suggest using a naming convention such as: [System] Super Moderator

Response

200
{
"access_token": "USER_JWT_AUTHORIZATION_TOKEN",
"scope": ["user"],
"sso_id": "10024010",
"permissions": {
"hostScopes": [
"super-mod",
"moderator",
"member",
"user"
],
"scopes": [
"super-mod",
"moderator",
"member",
"user"
]
}
}
400
{
"message": "Bad request",
"statusCode": 400
}
401
{
"message": "Unauthorized",
"statusCode": 401
}
  • USER_JWT_AUTHORIZATION_TOKEN - The User Authentication JWT token

USER_JWT_AUTHORIZATION_TOKEN is coupled to the host, and cannot be used for other hosts


Was this article helpful?
© 2026 All Rights Reserved. Created with ❤️ by Annoto