POST
Attach a file to a contact
Scope:
contacts:contacts.writehttps://api.holded.com/api/v2/contacts/{contactId}/attachmentsAttaches a file to a contact. Send the file as `multipart/form-data`. The file name is sanitised (special characters and spaces are removed). If a file with the same sanitised name already exists, the file content is overwritten but no duplicate entry is created in the attachments list.
Parameters
Path parameters
contactId
stringrequiredContact ID (24-char hex ObjectId)
Request body
object
filestring<binary>
Request
python
import requests
url = "https://api.holded.com/api/v2/contacts/{contactId}/attachments"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
}
files = {"file": open("file.pdf", "rb")}
response = requests.post(url, headers=headers, files=files)
print(response.json())Responses
Response
json
{
"id": "507f1f77bcf86cd799439011"
}Success responses
201File attachedapplication/jsonobject
idstring
Error responses
400Bad requestapplication/json401Invalid or missing API keyapplication/json403Insufficient permissionsapplication/json404Contact not foundapplication/json429Rate limit exceededapplication/json