We've launched a new documentation site. Visit docs.portal.io for the latest version.

Authentication

To call the authenticated public API you first need a User Key.

Use the authentication exchange endpoint documented here:

GET /authenticate/apikeyexchange

For the initial exchange:

  • send Portal username and password as query parameters
  • send X-MSS-API-APPID, X-MSS-CUSTOM-DATE, and X-MSS-SIGNATURE headers

Signing requests

Portal signs requests with HMAC-SHA256 and Base64-encodes the result.

Build the canonical message by concatenating these parts with no separator:

[HTTP method][absolute URL][content type][timestamp][user API key]

Rules:

  • Use the full absolute URL, including the query string when present.
  • Query parameters must be encoded exactly as sent.
  • For GET requests, omit the content-type segment.
  • For non-GET requests, include the exact content type sent in the request.
  • The timestamp must exactly match X-MSS-CUSTOM-DATE.
  • The user API key must exactly match X-MSS-API-USERKEY.
  • For the initial exchange, the user API key is empty in both places.
  • Use the Secret Key as raw ASCII bytes. Do not base64-decode it before computing the HMAC.

Example canonical message for the initial exchange:

GEThttps://api.portal.io/authenticate/apikeyexchange?UserName=user%40example.com&Password=MyP%40ss123Mon, 06 Apr 2026 00:22:19 GMT

If the exchange succeeds, use meta.apiKey from the response on all later authenticated requests. For the HMAC-based public API, this is the value that matters, not bearerToken.

Authenticate User & Get User Token

Exchange your Portal username and password for a User API Key. Send the HMAC authentication headers with this request to obtain the key.

Request
query Parameters
UserName
required
string <= 256 characters

user email address

Password
required
string <password>

user password

header Parameters
Accept
required
string

Accept Header

Value: "application/json"
X-MSS-API-APPID
required
string

Application Id

X-MSS-CUSTOM-DATE
required
string

A date timestamp of the request

X-MSS-SIGNATURE
required
string

A signature for the request

X-MSS-API-USERKEY
required
string

User API Key

Responses
200

Success

Response Schema: application/json
userId
string
sessionId
string
userName
string
displayName
string
referrerUrl
string
bearerToken
string
refreshToken
string
refreshTokenExpiry
string <date-time>
profileUrl
string
roles
Array of strings
permissions
Array of strings
authProvider
string
object (ResponseStatus)

ResponseStatus

object (Dictionary_String_String_)

Dictionary<String,String>

401

Invalid credentials or User Email is not verified

get/authenticate/apikeyexchange
Request samples
Response samples
application/json
{
  • "userId": "string",
  • "sessionId": "string",
  • "userName": "string",
  • "displayName": "string",
  • "referrerUrl": "string",
  • "bearerToken": "string",
  • "refreshToken": "string",
  • "refreshTokenExpiry": "2019-08-24T14:15:22Z",
  • "profileUrl": "string",
  • "roles": [
    ],
  • "permissions": [
    ],
  • "authProvider": "string",
  • "responseStatus": {
    },
  • "meta": {
    }
}