For a list of methods for this resource, see the end of this page.

Resource representations

The following JSON template is used for User.photos resources in the Directory API:

  "kind": "admin#directory#user#photo",
  "id": string,
  "etag": etag,
  "primaryEmail": string,
  "mimeType": string,
  "height": integer,
  "width": integer,
  "photoData": bytes
Property name Value Description Notes
kind string The type of the API resource. For Photo resources, this is admin#directory#user#photo.
id string The ID the API uses to uniquely identify the user.
primaryEmail string The user's primary email address.
height integer Height of the photo in pixels. writable
width integer Width of the photo in pixels. writable
photoData bytes The user photo's upload data in web-safe Base64 format in bytes. This means:
  • The slash (/) character is replaced with the underscore (_) character.
  • The plus sign (+) character is replaced with the hyphen (-) character.
  • The equals sign (=) character is replaced with the asterisk (*).
  • For padding, the period (.) character is used instead of the RFC-4648 baseURL definition which uses the equals sign (=) for padding. This is done to simplify URL-parsing.
  • Whatever the size of the photo being uploaded, the API downsizes it to 96x96 pixels.
mimeType string The MIME type of the photo. Allowed values are JPEG, PNG, GIF, BMP, TIFF, and web-safe base64 encoding. writable
etag etag ETag of the resource.


Removes the user's photo.
Retrieves the user's photo.
Adds a photo for the user. This method supports patch semantics.
Adds a photo for the user.

Send feedback about...

Directory API