Skip to main content
GET
/
v2
/
auth
/
whoami
Get current user
curl --request GET \
  --url https://api.affinity.co/v2/auth/whoami \
  --header 'Authorization: Bearer <token>'
{
  "tenant": {
    "id": 4503599627370496,
    "name": "<string>",
    "subdomain": "<string>"
  },
  "user": {
    "id": 4503599627370496,
    "firstName": "<string>",
    "lastName": "<string>",
    "emailAddress": "[email protected]"
  },
  "grant": {
    "type": "api-key",
    "scopes": [
      "<string>"
    ],
    "createdAt": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Response

OK

WhoAmI model

tenant
Tenant · object
required
Example:
{
"name": "Contoso Ltd.",
"subdomain": "contoso",
"id": 1
}
user
User · object
required
Example:
{
"firstName": "John",
"lastName": "Smith",
"emailAddress": "[email protected]",
"id": 1
}
grant
Grant · object
required
Example:
{
"createdAt": "2023-01-01T00:00:00Z",
"scopes": ["api"],
"type": "api-key"
}