Skip to main content

customers

Creates, updates, deletes, gets or lists a customers resource.

Overview

Namecustomers
TypeResource
Idgoogleadmin.directory.customers

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
idstringThe unique ID for the customer's Google Workspace account. (Readonly)
alternateEmailstringThe customer's secondary contact email address. This email address cannot be on the same domain as the customerDomain
customerCreationTimestring (date-time)The customer's creation time (Readonly)
customerDomainstringThe customer's primary domain name string. Do not include the www prefix when creating a new customer.
etagstringETag of the resource.
kindstringIdentifies the resource as a customer. Value: admin#directory#customer (default: admin#directory#customer)
languagestringThe customer's ISO 639-2 language code. See the Language Codes page for the list of supported codes. Valid language codes outside the supported set will be accepted by the API but may lead to unexpected behavior. The default value is en.
phoneNumberstringThe customer's contact phone number in E.164 format.
postalAddressobjectThe customer's postal address information. (id: CustomerPostalAddress)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectcustomerKeyRetrieves a customer.
patchupdatecustomerKeyPatches a customer.
updatereplacecustomerKeyUpdates a customer.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
customerKeystring

SELECT examples

Retrieves a customer.

SELECT
id,
alternateEmail,
customerCreationTime,
customerDomain,
etag,
kind,
language,
phoneNumber,
postalAddress
FROM googleadmin.directory.customers
WHERE customerKey = '{{ customerKey }}' -- required;

UPDATE examples

Patches a customer.

UPDATE googleadmin.directory.customers
SET
data__id = '{{ id }}',
data__customerDomain = '{{ customerDomain }}',
data__kind = '{{ kind }}',
data__etag = '{{ etag }}',
data__alternateEmail = '{{ alternateEmail }}',
data__customerCreationTime = '{{ customerCreationTime }}',
data__postalAddress = '{{ postalAddress }}',
data__phoneNumber = '{{ phoneNumber }}',
data__language = '{{ language }}'
WHERE
customerKey = '{{ customerKey }}' --required
RETURNING
id,
alternateEmail,
customerCreationTime,
customerDomain,
etag,
kind,
language,
phoneNumber,
postalAddress;

REPLACE examples

Updates a customer.

REPLACE googleadmin.directory.customers
SET
data__id = '{{ id }}',
data__customerDomain = '{{ customerDomain }}',
data__kind = '{{ kind }}',
data__etag = '{{ etag }}',
data__alternateEmail = '{{ alternateEmail }}',
data__customerCreationTime = '{{ customerCreationTime }}',
data__postalAddress = '{{ postalAddress }}',
data__phoneNumber = '{{ phoneNumber }}',
data__language = '{{ language }}'
WHERE
customerKey = '{{ customerKey }}' --required
RETURNING
id,
alternateEmail,
customerCreationTime,
customerDomain,
etag,
kind,
language,
phoneNumber,
postalAddress;