# Admin Directory API . users . photos

## Instance Methods

Remove photos for the user

Retrieve photo of a user

Add a photo for the user. This method supports patch semantics.

Add a photo for the user

### Method Details

`delete(userKey)`

    Remove photos for the user

    Args:
      userKey: string, Email or immutable Id of the user (required)

`get(userKey)`

    Retrieve photo of a user

    Args:
      userKey: string, Email or immutable Id of the user (required)

    Returns:
      An object of the form:

        { # JSON template for Photo object in Directory API.
          "mimeType": "A String", # Mime Type of the photo
          "kind": "admin#directory#user#photo", # Kind of resource this is.
          "photoData": "A String", # Base64 encoded photo data
          "height": 42, # Height in pixels of the photo
          "width": 42, # Width in pixels of the photo
          "etag": "A String", # ETag of the resource.
          "primaryEmail": "A String", # Primary email of User (Read-only)
          "id": "A String", # Unique identifier of User (Read-only)
        }

`patch(userKey, body)`

    Add a photo for the user. This method supports patch semantics.

    Args:
      userKey: string, Email or immutable Id of the user (required)
      body: object, The request body. (required)
        The object takes the form of:

    { # JSON template for Photo object in Directory API.
        "mimeType": "A String", # Mime Type of the photo
        "kind": "admin#directory#user#photo", # Kind of resource this is.
        "photoData": "A String", # Base64 encoded photo data
        "height": 42, # Height in pixels of the photo
        "width": 42, # Width in pixels of the photo
        "etag": "A String", # ETag of the resource.
        "primaryEmail": "A String", # Primary email of User (Read-only)
        "id": "A String", # Unique identifier of User (Read-only)
      }

    Returns:
      An object of the form:

        { # JSON template for Photo object in Directory API.
          "mimeType": "A String", # Mime Type of the photo
          "kind": "admin#directory#user#photo", # Kind of resource this is.
          "photoData": "A String", # Base64 encoded photo data
          "height": 42, # Height in pixels of the photo
          "width": 42, # Width in pixels of the photo
          "etag": "A String", # ETag of the resource.
          "primaryEmail": "A String", # Primary email of User (Read-only)
          "id": "A String", # Unique identifier of User (Read-only)
        }

`update(userKey, body)`

    Add a photo for the user

    Args:
      userKey: string, Email or immutable Id of the user (required)
      body: object, The request body. (required)
        The object takes the form of:

    { # JSON template for Photo object in Directory API.
        "mimeType": "A String", # Mime Type of the photo
        "kind": "admin#directory#user#photo", # Kind of resource this is.
        "photoData": "A String", # Base64 encoded photo data
        "height": 42, # Height in pixels of the photo
        "width": 42, # Width in pixels of the photo
        "etag": "A String", # ETag of the resource.
        "primaryEmail": "A String", # Primary email of User (Read-only)
        "id": "A String", # Unique identifier of User (Read-only)
      }

    Returns:
      An object of the form:

        { # JSON template for Photo object in Directory API.
          "mimeType": "A String", # Mime Type of the photo
          "kind": "admin#directory#user#photo", # Kind of resource this is.
          "photoData": "A String", # Base64 encoded photo data
          "height": 42, # Height in pixels of the photo
          "width": 42, # Width in pixels of the photo
          "etag": "A String", # ETag of the resource.
          "primaryEmail": "A String", # Primary email of User (Read-only)
          "id": "A String", # Unique identifier of User (Read-only)
        }