Contacts

save()

api.mail.contacts.save({ address, name?, image? }) → Promise<Contact>

Creates or changes a contact. The photo goes into the account's own storage, and it wins over anything found on the sender's domain.

creates or replacesimage: null keeps the namecounted in the quota
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

await api.mail.contacts.save({
  address: "fedy@example.net",
  name: "Fedy",
  image: { data: bytes, type: "image/jpeg" },
});

await api.mail.contacts.save({ address: "fedy@example.net", image: null });   // drop the photo, keep the name
api.mail.contacts.save(
    address="fedy@example.net",
    name="Fedy",
    image={"data": jpeg_bytes, "type": "image/jpeg"},
)

api.mail.contacts.save(address="fedy@example.net", image=None)   # drop the photo, keep the name
addressstringrequired

The correspondent. The key.

namestring

What to show.

imageobject|null

{ data, type }. null removes the photo and keeps the rest.

It wins over a domain logo

A logo is a company's mark; a photo is a person

That is the whole reason the address book exists. A domain logo is right for an organisation and wrong for a person — and on a consumer domain it would be the provider's logo for every one of them.

The bytes are the account's

Stored in its object storage, visible in its listing, counted in its quota, deletable. Nothing is sent anywhere else to find out who writes to the customer.

The same address replaces

There is no separate update. Saving an address that exists changes it — and omitting a field leaves it as it was, except image: null, which removes the photo deliberately.

A new photo gets a new address

Which is what expires caches. The old one stops being referenced.