Get authorization details

Get authorization token details including validity information

  • HTTP Method: GET
  • URL: https://example.domain.tld/api/v1/auth/
  • Require authentication: Yes
  • Permission level required: MasterAdmin / DomainAdmin / MailUser

Response parameters

Parameter Type Description
auth dict The authentication status object
username str Your account username
status str Authentication status
message str Authentication status description
perm_level str Your account permission level
valid_from int Token start of validity as UNIX timestamp (seconds)
valid_to int Token expiry as UNIX timestamp (seconds)

Example request (Python)

import requests
import json
from pprint import pprint

url = "https://example.domain.tld/api/v1/auth/"
r = requests.get(url, auth=("admin","long-auth_token-here"))
try:
    pprint(r.json())
except:
    print(r.text)

Example request (curl)

curl -X GET https://example.domain.tld/api/v1/auth/ -u "admin:long-auth_token-here"

Example response (JSON)

{'auth': {'message': 'Authorization valid',
          'perm_level': 'MasterAdmin',
          'status': 'valid',
          'username': 'admin',
          'valid_from': 1582536536,
          'valid_to': 1582622936}}