Skip to content

Creates a new Google Service Account with the provided details
Stable

Request

Creates a new Google Service Account with the provided details.

Creates and stores a Google Service Account record for the tenant's Google Enterprise, used for server-to-server authentication with Google's EMM APIs.

About Google Service Account Some Google EMM operations require server-to-server authentication via a Google Service Account. This endpoint registers that account's credential material with Esper so it can be used for those operations going forward.

Key Fields / Query Parameters

  • google_enterprise_id — ID of the Google enterprise this service account belongs to
  • key_id — Identifier for the service account key
  • data — Service account credential data
  • is_active — Whether this service account should be treated as active

Common Use Cases

  • Setting up server-to-server EMM authentication for a newly enrolled Google Enterprise
  • Rotating a service account's credentials by creating a replacement record
  • Recovering EMM automation after a previous service account was revoked

Best Practices

  • Treat the data and public_data fields as sensitive credential material — avoid logging them
  • Deactivate or remove old service account records when rotating credentials, to avoid ambiguity about which is active
  • Confirm the new account works (via a test EMM API call) before decommissioning an older one

Workflow

  1. Obtain the new service account credentials from Google
  2. POST them to this endpoint to register the account with Esper
  3. Confirm the account is active via GET /v2/emm/accounts/ and test EMM automation
Headers
Authorizationstringrequired

Bearer token for authorization

Bodyapplication/jsonrequired
tenant_idstring
google_enterprise_idstring
namestring
key_idstring
typeinteger
is_setboolean
is_activeboolean
datastring
public_datastring
created_atstring, (date-time)
updated_atstring, (date-time)
cURL
curl -i -X POST \
  https://develop-api.esper.io/_mock/openapi/v2/emm/accounts/ \
  -H 'Authorization: string' \
  -H 'Content-Type: application/json' \
  -d '{
    "tenant_id": "string",
    "google_enterprise_id": "string",
    "name": "string",
    "key_id": "string",
    "type": 0,
    "is_set": true,
    "is_active": true,
    "data": "string",
    "public_data": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  }'

Responses

Successful Response

Bodyapplication/json
tenant_idstring
google_enterprise_idstring
namestring
key_idstring
typeinteger
is_setboolean
is_activeboolean
datastring
public_datastring
created_atstring, (date-time)
updated_atstring, (date-time)
Response
{ "tenant_id": "string", "google_enterprise_id": "string", "name": "string", "key_id": "string", "type": 0, "is_set": true, "is_active": true, "data": "string", "public_data": "string", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z" }