Skip to content

Create a Google user and, if request body is not provided, generate a Google auth token for a specific device on the Google EMM side.
Stable

Request

⚠️ Android only.

Creates a Google EMM user for a device and links it in Esper.

With no request body, Esper creates the Google user on the Google EMM side and generates an authentication token for the device. Check for an existing account with GET first to avoid duplicates.

About Creating a Device Google Account Esper normally creates this account during enrollment. Use this endpoint when a device enrolled without one.

Key Fields / Query Parameters

  • deviceId — UUID of the device
  • Request body (optional) — When included, tenant_id, google_user_id, device_id, and account_type are required
Path
deviceIdstring, (uuid)required

The unique identifier of the device for which Google account details need to be updated.

Bodyapplication/json
tenant_idstring, (uuid)required

The ID of the tenant associated with the Google account.

google_user_idstringrequired

The unique identifier for the Google user.

device_idstring, (uuid)required

The ID of the device associated with the Google account.

google_device_idstring

The unique identifier for the Google device.

account_identifierstring

An identifier for the account.

account_typeintegerrequired

The type of the Google account.

google_authentication_tokenstring

The authentication token for the Google account.

created_atstring, (date-time)

The timestamp when the Google account was created.

updated_atstring, (date-time)

The timestamp when the Google account was last updated.

cURL
curl -i -X POST \
  'https://api.esper.io/_mock/openapi/v2/devices/{deviceId}/google-accounts/' \
  -H 'Content-Type: application/json' \
  -d '{
    "tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",
    "google_user_id": "string",
    "device_id": "3bafab7b-4400-4bcf-8e6e-09f954699940",
    "google_device_id": "string",
    "account_identifier": "string",
    "account_type": 0,
    "google_authentication_token": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  }'

Responses

Successfully updated the Google account details.

Bodyapplication/json
contentobject(device_GoogleAccount)
Response
{ "content": { "tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0", "google_user_id": "string", "device_id": "3bafab7b-4400-4bcf-8e6e-09f954699940", "google_device_id": "string", "account_identifier": "string", "account_type": 0, "google_authentication_token": "string", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z" } }