# UserInfo

#### Description
Returns identifying information for the authenticated account. This is defined as part of the <a href="http://openid.net/specs/openid-connect-core-1_0.html#UserInfo">OpenID</a> spec.

#### URL format
```
{data_center_url}/v1/userinfo
```

#### Example Request
```http
GET /v1/userinfo HTTP/1.1
Host: {data_center_url}
Authorization: Bearer {ACCESS_TOKEN}
```

#### Example Response
```http
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "sub": "acc_5700a00eb0ccd07000000000",
  "email": "janed@company.com",
  "name": "Jane Doe",
  "zoneinfo": "Europe/London",
  "cronofy.type": "account",
  "cronofy.data": {
    "authorization": {
      "scope": "read_write",
      "status": "active"
    },
    "profiles": [
      {
        "provider_name": "google",
        "provider_service": "gsuite",
        "profile_id": "pro_n23kjnwrw2",
        "profile_name": "example1@cronofy.com",
        "profile_connected": true,
        "profile_initial_sync_required": true,
        "profile_calendars": [
          {
            "calendar_id": "cal_n23kjnwrw2_jsdfjksn234",
            "calendar_name": "Home",
            "calendar_readonly": false,
            "calendar_deleted": false,
            "calendar_primary": true,
            "calendar_integrated_conferencing_available": true,
            "calendar_attachments_available": false,
            "permission_level": "sandbox"
          },
          {
            "calendar_id": "cal_n23kjnwrw2_n1k323nkj23",
            "calendar_name": "Work",
            "calendar_readonly": true,
            "calendar_deleted": true,
            "calendar_primary": false,
            "calendar_integrated_conferencing_available": true,
            "calendar_attachments_available": false,
            "permission_level": "sandbox"
          }
        ]
      },
      {
        "provider_name": "apple",
        "provider_service": "icloud",
        "profile_id": "pro_fe145c37de",
        "profile_name": "example2@cronofy.com",
        "profile_connected": false,
        "profile_initial_sync_required": false,
        "profile_relink_url": "https://app.cronofy.com/relink/apple?email=example@cronofy.com",
        "profile_calendars": [
          {
            "calendar_id": "cal_fe145c37de_3nkj23wejk1",
            "calendar_name": "Bank Holidays",
            "calendar_readonly": true,
            "calendar_deleted": false,
            "calendar_primary": false,
            "calendar_integrated_conferencing_available": false,
            "calendar_attachments_available": true,
            "permission_level": "sandbox"
          }
        ]
      },
      {
        "provider_name": "exchange",
        "provider_service": "office365",
        "profile_id": "pro_FFuvCw72y4",
        "profile_name": "example3@cronofy.onmicrosoft.com",
        "profile_connected": true,
        "profile_initial_sync_required": false,
        "provider_protocol": "graph_api",
        "profile_calendars": [
          {
            "calendar_id": "cal_FFuvCw72y4_aSrSEB3BtekI",
            "calendar_name": "Calendar",
            "calendar_readonly": false,
            "calendar_deleted": false,
            "calendar_primary": true,
            "calendar_integrated_conferencing_available": true,
            "calendar_attachments_available": true,
            "permission_level": "sandbox"
          }
        ]
      }
    ]
  }
}
```

#### Request parameters
##### `data_center_url` *(required)*

The URL for the data center you want to communicate with. Possible choices are:

- `api-au.cronofy.com` - Australia
- `api-ca.cronofy.com` - Canada
- `api-de.cronofy.com` - Germany
- `api-sg.cronofy.com` - Singapore
- `api-uk.cronofy.com` - United Kingdom
- `api.cronofy.com` - United States

Find out more about [Cronofy's data centers](/developers/data-centers/index.md).
#### Response parameters
##### `sub`

This specifies the internal Cronofy ID for the account, as an ASCII-only [`String`](/developers/api/data-types/index.md) with a fixed length of 28 characters.

##### `email` *(optional)*

The primary email address associated with the account as a [`String`](/developers/api/data-types/index.md).

When the account is a Service Account, this value may represent a username instead of a full email address. For example, when authenticating a Service Account via Active Directory username and password.

##### `name` *(optional)*

The name associated with the account as a [`String`](/developers/api/data-types/index.md). May be `null` or blank.

##### `zoneinfo` *(optional)*

A [`String`](/developers/api/data-types/index.md) representing a known time zone identifier from the [IANA Time Zone Database](https://www.iana.org/time-zones).

Common examples are:

- `Etc/UTC`

- `Europe/Paris`

- `America/Chicago`

> **WARNING:** The default time zone is extracted on a best-effort basis from the underlying providers. We do not receive default time zone information from all providers and so the account's default time zone may be returned with a time zone identifier of `Etc/UTC`.

As providers expose this data, or we implement deeper integrations with their platforms, the time zone data available to you will be improved without changes being required to your code.

##### `cronofy.type`

This specifies the type of the account as a [`String`](/developers/api/data-types/index.md).

This can be used to know the format of data that can be expected within `cronofy.data`.

##### `cronofy.data`

A custom structure within which detail information about the authorization and account are provided.

##### `cronofy.data.authorization`

Includes information relating to the authenticated authorization.

##### `cronofy.data.authorization.scope`

This specifies the scope granted for the account for the active authorization as a space-separated [`String`](/developers/api/data-types/index.md) in order to mimic how it is provided during an [Authorization Request](/developers/api/authorization/request-authorization/index.md).

##### `cronofy.data.authorization.status`

The current status of the authorization. Currently two possible values are supported.

- `active` - your authorization to their Account is active and their Profiles are actively being synced.

- `hibernated` - your authorization to their Account is currently in a hibernated state. Using this Account in a qualifying API call will trigger the status to switch to `active` and Profile syncing to be activated.

##### `cronofy.data.profiles` *(optional)*

Details of the calendar profiles associated with the account, where relevant.

##### `cronofy.data.profiles.provider_name`

This specifies the provider of the calendar as a lowercase, ASCII-only [`String`](/developers/api/data-types/index.md).

Currently one of:

- `apple`

- `cronofy`

- `exchange`

- `google`

- `google_free_busy`

- `live_connect`

- `ms_graph_free_busy`

However, this will be expanded over time and therefore consumers should support any value for this field.

##### `cronofy.data.profiles.provider_service`

This specifies the service that hosts the calendar as a lowercase, ASCII-only [`String`](/developers/api/data-types/index.md).

Currently one of:

- `cronofy`

- `exchange`

- `google`

- `gsuite`

- `icloud`

- `office365`

- `outlook_com`

However, this will be expanded over time and therefore consumers should support any value for this field.

This should be used to help a user distinguish between their profiles as they can have multiple profiles with the same name.

##### `cronofy.data.profiles.profile_id`

This specifies the ID of the profile, a profile may consist of many calendars, as an ASCII-only [`String`](/developers/api/data-types/index.md).

This is used for targeting other API actions toward this profile.

##### `cronofy.data.profiles.profile_name`

This specifies the name of the profile as a [`String`](/developers/api/data-types/index.md).

##### `cronofy.data.profiles.profile_connected`

This specifies whether we have an active connection for this profile, usually whether we have valid credentials or not, as a [`Boolean`](/developers/api/data-types/index.md).

##### `cronofy.data.profiles.profile_initial_sync_required`

This specifies whether we have performed an initial sync on this profile.

When connected a calendar via Individual Connect, Cronofy will provide an [access token](/developers/api/authorization/request-token/index.md) and then start syncing the calendar data. During this period, we don't yet have a complete calendar data. This can take between a few seconds to a few minutes depending on the quantity of data in the calendar. This indicates that while you can begin calling the API for this account, you will not see all events and Availability Query won't be based on the full calendar content yet.

For newly connected Enterprise Connect profiles, the value is always `false`, as we won't send the access token until the initial sync is completed.

Once Cronofy has completed an initial sync, this value remains `false`.

##### `cronofy.data.profiles.provider_protocol` *(optional)*

This specifies the protocol Cronofy is using to communicate with an Office 365
calendar, ASCII-only [`String`](/developers/api/data-types/index.md).

Currently one of:

- `graph_api`

- `exchange_web_services`

If the protocol is `exchange_web_services`, there will also be a
`graph_api_migration_url` parameter provided to aid transit to `graph_api`. For details, please reference [Removal of EWS support for 365 calendars](/developers/office365-graph/index.md).

##### `cronofy.data.profiles.graph_api_migration_url` *(optional)*

When the `provider_protocol` is `exchange_web_services`, `graph_api_migration_url` is provided to aid transit the calendar profile to `graph_api`.

For details, please reference [Removal of EWS support for 365 calendars](/developers/office365-graph/index.md).

##### `cronofy.data.profiles.profile_relink_url` *(optional)*

<blockquote>
</blockquote>
When the profile is not connected, a URL will be provided as a [`String`](/developers/api/data-types/index.md) that you can direct the user to in order for them to reconnect this profile.

This URL is unique to each profile as it contains information relating to the underlying provider and so forth.

##### `cronofy.data.profiles.profile_calendars.calendar_id`

This specifies the ID of the calendar as an ASCII-only [`String`](/developers/api/data-types/index.md) with a fixed length of 43 characters.

This is used for targeting other API actions toward this calendar.

##### `cronofy.data.profiles.profile_calendars.calendar_name`

This specifies the name of the calendar as a [`String`](/developers/api/data-types/index.md).

This should be used to help a user distinguish between their calendars as they can have multiple calendars within the same profile.

##### `cronofy.data.profiles.profile_calendars.calendar_readonly`

This specifies whether the calendar is readonly as a [`Boolean`](/developers/api/data-types/index.md).

Calendars where `calendar_readonly` is `true` will refuse requests to create, update, or delete events.

##### `cronofy.data.profiles.profile_calendars.calendar_deleted`

This specifies whether the calendar has been deleted as a [`Boolean`](/developers/api/data-types/index.md).

Calendars where `calendar_deleted` is `true` will refuse requests to create, update, or delete events.

##### `cronofy.data.profiles.profile_calendars.calendar_primary`

This specifies whether the calendar is the primary calendar for its profile as a [`Boolean`](/developers/api/data-types/index.md).

Current support by provider:

- **Apple** has no concept of primary calendars

- **Exchange** has a primary calendar which cannot change

- **Google** has a primary calendar which cannot change

- **Office 365** has a primary calendar which cannot change

- **Outlook.com** has a primary calendar which can change

##### `cronofy.data.profiles.profile_calendars.calendar_integrated_conferencing_available`

This specifies whether the calendar supports [integrated conferencing](/developers/api/conferencing-services/index.md) as a [`Boolean`](/developers/api/data-types/index.md). Currently this `true` for:

- Google calendars which have Google Meet available.

- Office 365 calendars [connected using the Graph API](/developers/office365-graph/index.md) which have MS Teams available.

##### `cronofy.data.profiles.profile_calendars.calendar_attachments_available`

This specifies whether the calendar supports adding [attachments](/developers/api/attachments/index.md) to events as a [`Boolean`](/developers/api/data-types/index.md).

Currently this is `true` for the following providers:

- **Apple**

- **Exchange**

- **Google** with [Drive permission](/developers/faqs/google-scopes/index.md) granted

- **Office 365**

> **WARNING:** Please note that [additional authorization scope](/developers/api/attachments/authorization/index.md) is required to allow the use of attachments.

##### `cronofy.data.profiles.profile_calendars.permission_level`

This value specifies the current permission level granted to the client for the
specified calendar. Permitted values are currently either `sandbox`
or `unrestricted`.

In order to perform a [edit](/developers/api/events/edit-external-events/index.md) or [delete](/developers/api/events/delete-external-event/index.md) on external events you must have `unrestricted` access
to the calendar.

#### Application Calendar specific response parameters
Relevent when `cronofy.type` is `application_calendar`.

##### `cronofy.data.application_calendar.application_calendar_id`

The [`String`](/developers/api/data-types/index.md) that uniquely identifies the application calendar.

#### Service Account specific response parameters
Relevant when `cronofy.type` is `service_account`.

##### `cronofy.data.service_account.provider_name`

This specifies the provider of the service account as a lowercase, ASCII-only [`String`](/developers/api/data-types/index.md).

Currently one of:

- `exchange`

- `google`

- `google_free_busy`

- `ms_graph_calendars`

- `ms_graph_free_busy`

##### `cronofy.data.service_account.domain`

The domain the service account relates to as an ASCII-only [`String`](/developers/api/data-types/index.md).

We may not be able to determine this, and this property is not guaranteed to be populated.

##### `cronofy.data.authorization.delegated_scope`

This specifies the delegated scope granted for the service account for the active authorization as a space-separated [`String`](/developers/api/data-types/index.md) in order to mimic how it is provided during an [Enterprise Connect Authorization Request](/developers/api/enterprise-connect/request-authorization/index.md).

#### Error responses
##### 401 Unauthorized

The request was refused as the provided [authentication credentials](/developers/api/authentication/index.md) were not recognized.

When an OAuth `refresh_token` is available then it should be used to [request a replacement `access_token`](/developers/api/authorization/refresh-token/index.md) before the request is retried.



---
[Read in HTML](/developers/api/identity/userinfo/)