Auth

Get current user

Changed on

Returns information about the authenticated user, their current organization, and API key permissions. Use this endpoint to verify your authentication and understand your available API access levels.

get/v2/auth/whoami

Request

  • Base URL
    https://api.affinity.co
  • URL
    https://api.affinity.co/v2/auth/whoami
  • Auth
    HTTP bearer

Response

OK

Example response

{
  "tenant": {
    "id": 1,
    "name": "Contoso Ltd.",
    "subdomain": "contoso"
  },
  "user": {
    "id": 1,
    "firstName": "John",
    "lastName": "Smith",
    "emailAddress": "john.smith@contoso.com"
  },
  "grant": {
    "type": "api-key",
    "scopes": [
      "api"
    ],
    "createdAt": "2023-01-01T00:00:00Z"
  }
}

Changes

    • info

      added authentication authorization bad-request conflict method-not-allowed not-acceptable not-found not-implemented rate-limit server timeout unprocessable-entity unsupported-media-type validation discriminator mapping keys to the / response property for the response status