> ## Documentation Index
> Fetch the complete documentation index at: https://developers.hubspot.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

---
id: 5e0ca51f-37c4-4a5a-936b-6f99a5e843d0
---

# Record images API (BETA)

> Retrieve, set, and clear the images displayed for CRM records, such as contact photos and company logos.

> [accordion] Scope requirements

> [!WARNING]
>
> This functionality is currently in beta. By participating in this beta, you agree to HubSpot's [Developer Terms](https://legal.hubspot.com/developer-terms) and [Developer Beta Terms](https://legal.hubspot.com/developerbetaterms). Note that the functionality is still under active development and is subject to change based on testing and feedback.

Use the record images API to retrieve the image displayed for a CRM record, or to set or clear a custom image for a record. Record images are the profile-picture style images shown on record and index pages, such as a contact's photo or a company's logo. Use this API to display HubSpot record images in your own app or to keep them in sync with an external system.

Record images are supported for the following objects:

| Object type | `objectTypeId` |
| - | - |
| Contacts | `0-1` |
| Companies | `0-2` |
| Custom objects | `2-XXX` |
| Products | `0-7` |
| Marketing events | `0-54` |

## Retrieve a record image

To retrieve the image for a single record, make a `GET` request to `/crm/record-images/2027-03-beta/{objectTypeId}/{objectId}`. Include the object type's ID and the record's ID in the path.

For example, to retrieve the image for the contact with the record ID `51`, make a `GET` request to `/crm/record-images/2027-03-beta/0-1/51`.

The response includes a [signed URL](#signed-urls) for the image and the time that the URL expires.

```json theme={null}
{
  "url": "https://api.hubapi.com/avatars/v1/signed-uris/{segment}",
  "expiresAt": "2027-03-10T15:47:43Z"
}
```

| Field | Type | Description |
| - | - | - |
| `url` | String | A signed URL for the record's current image. Learn more about [signed URLs](#signed-urls) and [how images resolve](#how-record-images-resolve). |
| `expiresAt` | String | The time the URL expires, as an ISO-8601 UTC timestamp. This doesn't affect the record's image: a custom image stays until you replace or clear it. |

The request can return the following error statuses:

| Status code | Description |
| - | - |
| `400` | The object type ID isn't supported. |
| `403` | The request is missing a required scope. |
| `404` | No record exists with the provided object type and record ID, or the user associated with a [user-level token](#authentication-and-permissions) can't view it. |

### Retrieve a batch of record images

To retrieve images for multiple records of the same object, make a `POST` request to `/crm/record-images/2027-03-beta/{objectTypeId}/batch/read`. You can include up to 100 records per request.

| Parameter | Description |
| - | - |
| `inputs` required | An array of objects, each with an `id` string. The value is either the record ID or, when `idProperty` is set, the value of that property. Duplicate values return a single result. |
| `idProperty` | An optional parameter used to identify contacts by `email` or companies by `domain`. |

By default, the `id` values in the request are record IDs (`hs_object_id`). To look up contact records by email or company records by domain, include the field `idProperty` and set it to `email` (contacts) or `domain` (companies).

For example, the following request retrieves images for two contacts by email address:

```json theme={null}
{
  "idProperty": "email",
  "inputs": [
    { "id": "ada@acme.com" },
    { "id": "grace@corp.io" }
  ]
}
```

The response includes a `results` array and an `errors` array. Each result echoes the value you sent as its `id`. Both arrays are always present in the response.

Batch read returns the following status codes:

| Status code | Description |
| - | - |
| `200` | Every input resolved successfully. |
| `207` | Some inputs failed. Check the `errors` array. |
| `400` | The `objectTypeId` isn't supported, the `idProperty` isn't allowed for the object type, `inputs` is empty or contains more than 100 values, or every input is malformed. |
| `403` | The request is missing a required scope. |
| `500` | The whole request failed. Individual failures aren't reported with this status. |

The following error categories can appear in `errors`:

| Category | Description |
| - | - |
| `OBJECT_NOT_FOUND` | No record matches the value, or the caller can't view the record. If every input is well-formed but none match, `results` is empty. |
| `VALIDATION_ERROR` | The value is malformed, such as a non-numeric record ID. |

In the following example, one contact was found and one wasn't:

```json theme={null}
{
  "results": [
    {
      "id": "ada@acme.com",
      "url": "https://...fs1.hubapi.com/...",
      "expiresAt": "2027-03-10T15:47:43Z"
    }
  ],
  "errors": [
    {
      "category": "OBJECT_NOT_FOUND",
      "message": "Could not get some CONTACT objects, they may be deleted or not exist. Check that ids are valid.",
      "ids": ["grace@corp.io"]
    }
  ]
}
```

## Set a custom record image

To set a custom image for a record, make a `PUT` request to `/crm/record-images/2027-03-beta/{objectTypeId}/{objectId}`. You can set custom images on contacts, companies, custom object records, products, and marketing events.

Send the image as a file upload, using the `multipart/form-data` content type with the image in a `file` form parameter. HubSpot resizes the image if needed, stores it as a hidden file, and saves the file's File Manager key to the record's `hs_avatar_filemanager_key` property. The file doesn't appear in the HubSpot files tool, but anyone with the image's URL can view it.

The new image is displayed in place of any previous custom image, enriched image, or default image.

The following example uploads an image for the contact with the record ID `51`:

```bash theme={null}
curl --request PUT \
  --url https://api.hubapi.com/crm/record-images/2027-03-beta/0-1/51 \
  --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  --form 'file=@/path/to/image.png'
```

The response includes the image's [signed URL](#signed-urls), the file's `id`, and the file's creation timestamp.

```json theme={null}
{
  "url": "https://{HubID}.fs1.hubspotusercontentqa-na1.net/hubfs/{HubID}/fdc045e7-c34f-4c1a-b005-fbf85305a732.png",
  "id": "hubfs/890441288/fdc045e7-c34f-4c1a-b005-fbf85305a732.png",
  "createdAt": "2027-03-01T18:28:58.522Z",
  "expiresAt": "2027-03-02T18:28:58.522Z"
}
```

| Field | Type | Description |
| - | - | - |
| `url` | String | A [signed URL](#signed-urls) for the record's image after the override is applied. |
| `id` | String | The unique key of the uploaded file. This is the new value of the `hs_avatar_filemanager_key` property. |
| `createdAt` | String | The time the uploaded file was created. |
| `expiresAt` | String | The time the URL expires, as an ISO-8601 UTC timestamp. This doesn't affect the record's image: a custom image stays until you replace or clear it. |

The request can return the following errors:

| Status code | Description |
| - | - |
| `400` | The object type ID isn't supported, the `file` field is missing, the file isn't a valid image, or the image's aspect ratio is too extreme to resize. |
| `403` | The request is missing a required scope, or the user can view the record but can't edit it. |
| `404` | No record exists with the provided object type and record ID, or the user can't view it. |
| `413` | The image exceeds the maximum file size (10 MB or 10,000 px on either side). Images over 1 MB or 500 px are downscaled. |

## Clear a custom record image

To clear a record's custom image, make a `DELETE` request to `/crm/record-images/2027-03-beta/{objectTypeId}/{objectId}`.

For example, to clear the custom image for the contact with the record ID `51`, make a `DELETE` request to `/crm/record-images/2027-03-beta/0-1/51`.

A successful request returns a `204 No Content` response. The record then displays the image it would have without a custom image, such as an enriched image or the default image. Learn more about [how images resolve](#how-record-images-resolve).

The uploaded file isn't deleted from the File Manager. HubSpot sets the record's `hs_avatar_filemanager_key` property to an empty value, and the record's property history keeps the previous values.

The request can return the following errors:

| Status code | Description |
| - | - |
| `400` | The object type ID is invalid. |
| `403` | The request is missing a required scope, or the user can view the record but can't edit it. |
| `404` | No record exists with the provided object type and record ID, or the user can't view it. |

## Signed URLs

Every URL returned by this API is a signed URL that expires after one day. Each response includes an `expiresAt` timestamp next to the `url`. It's recommended to request a new URL when you need to display the image. Don't store, email, or embed signed URLs in web pages. If you need to keep the image, download it.

* **Expired URLs:** a request to an expired URL returns a `410 Gone` error. Fetch a new URL from the API.
* **Invalid URLs:** a tampered or malformed URL returns a `400` error.
* **Data included in signed URLs:** URLs are signed by record ID, even when you look up a record by email address or domain. A URL's contents can be decoded and include the account ID, object type, record ID, issue time, expiry time, and image size. It doesn't include an email address, domain, user ID, or IP address.

## How record images resolve

A record's image comes from the first of the following sources that exist:

1. **Custom image:** an image you've set on the record, either in HubSpot or through this API. The image's File Manager key is stored in the record's `hs_avatar_filemanager_key` property.
2. **Enriched image:** an image HubSpot found through data enrichment (contacts and companies only).
3. **Default image:** HubSpot's default image for the object type.

For contacts and companies, enrichment and parent-domain lookups can change which image shows:

* **Contacts (retrieved by `hs_object_id` or `email`):** a contact's custom image is used first. If the contact has none, HubSpot checks the contact's email, then each parent domain (for example, `eu.acme.com`, then `acme.com`). At each level, HubSpot uses the logo of a company on that domain that the caller can view, or else the domain's enriched image. If none exist, the default image is used.
* **Companies**:
  * **Retrieved by `hs_object_id`:** a company's custom image is used first. If the company has none, it shows the enriched image for its domain, then for its parent domains, and then the default image.
  * **Retrieved by `domain`:** companies can share a domain, so HubSpot returns one of them. It uses the first company on the parent domain that has its own logo and that the caller can view. If no company the caller can view is on the exact domain, HubSpot uses the nearest parent domain that has an image. For example, `eu.acme.com` with no company of its own returns the company on `acme.com`, including its custom logo. Within a domain, a company with its own logo wins, otherwise the first company is returned. An `OBJECT_NOT_FOUND` error applies when no viewable company exists on the domain or any of its parents.

## Authentication and permissions

### Scopes

Each endpoint requires both a record images scope and the CRM scope for the object type in the request path. A request that's missing either scope returns a `403` error.

| Endpoints | Record images scope | Object type permission |
| - | - | - |
| `GET`, batch read | `avatars-signed-uri-access` | Read access for the object (e.g., `crm.objects.contacts.read` for contacts) |
| `PUT`, `DELETE` | `avatars-write` | Write access for the object (e.g., `crm.objects.contacts.write` for contacts) |

### Permissions

All record images endpoints accept both account-level (private app or service) tokens and user-level tokens. Account-level tokens can access all records in the account that the token's scopes allow. When you use a user-level token, the user's record permissions apply:

* If the user can't view a record, the API treats the record as not found. Requests return a `404` error, and batch read returns an `OBJECT_NOT_FOUND` error for that record.
* If the user can view a record but can't edit it, `PUT` and `DELETE` requests return a `403` error.
