# List Attachments

Retrieve the resources attached to a specific CRM record, based on the object ID and object type. Use this API to fetch all linked files and/or folders associated with a CRM record.

> Kind: REST endpoint · Updated: Mar 6, 2026 · GET /v1/attachments

Retrieve the resources attached to a specific CRM record, based on the object ID and object type. Use this API to fetch all linked files and/or folders associated with a CRM record.

### Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| objectId | string | optional | Object Id is required |
| objectType | string | optional | Object Type is optional. For Hubspot value must be one of CONTACT, TICKET, COMPANY, DEAL. Required to list Hubspot attachments. |

### Header parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Authorization | string | optional | Replace the API_Key placeholder with your actual API key. |

## Request body

```json
{
  "resource": "{{resource-id}}",
  "resourceType": "folder",
  "source": "HUBSPOT",
  "objectType": "CONTACT",
  "objectId": "51"
}
```

## Example request

**cURL**
```bash
curl --request GET \
     --url 'https://api.cloudfiles.io/v1/attachments?objectId=string&objectType=string' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --header 'authorization: Bearer API_Key' \
     --data '"{\n  \"resource\": \"{{resource-id}}\",\n  \"resourceType\": \"folder\",\n  \"source\": \"HUBSPOT\",\n  \"objectType\": \"CONTACT\",\n  \"objectId\": \"51\"\n}"'
```

**JavaScript**
```js
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
myHeaders.append("authorization", "Bearer API_Key");

var raw = JSON.stringify("{\n  \"resource\": \"{{resource-id}}\",\n  \"resourceType\": \"folder\",\n  \"source\": \"HUBSPOT\",\n  \"objectType\": \"CONTACT\",\n  \"objectId\": \"51\"\n}");

var requestOptions = {
   method: 'GET',
   headers: myHeaders,
   body: raw,
   redirect: 'follow'
};

fetch("https://api.cloudfiles.io/v1/attachments?objectId=string&objectType=string", requestOptions)
   .then(response => response.text())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
```

**Ruby**
```ruby
require "uri"
require "json"
require "net/http"

url = URI("https://api.cloudfiles.io/v1/attachments?objectId=string&objectType=string")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request["authorization"] = "Bearer API_Key"
request.body = JSON.dump("{\n  \"resource\": \"{{resource-id}}\",\n  \"resourceType\": \"folder\",\n  \"source\": \"HUBSPOT\",\n  \"objectType\": \"CONTACT\",\n  \"objectId\": \"51\"\n}")

response = https.request(request)
puts response.read_body

```

**Python**
```py
import requests
import json

url = "https://api.cloudfiles.io/v1/attachments?objectId=string&objectType=string"

payload = json.dumps("{\n  \"resource\": \"{{resource-id}}\",\n  \"resourceType\": \"folder\",\n  \"source\": \"HUBSPOT\",\n  \"objectType\": \"CONTACT\",\n  \"objectId\": \"51\"\n}")
headers = {
   'accept': 'application/json',
   'content-type': 'application/json',
   'authorization': 'Bearer API_Key'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

```

## Response body

```json
[
  {
    "id": "att_123",
    "type": "external",
    "objectId": "deal_456",
    "objectType": "hubspot_deal",
    "createdAt": "2026-07-05T10:00:00Z",
    "createdBy": "usr_1"
  },
  {
    "id": "att_124",
    "type": "internal",
    "objectId": "fld_789",
    "objectType": "folder",
    "createdAt": "2026-07-06T11:00:00Z",
    "createdBy": "usr_2"
  }
]
```
