# save()

Canonical URL: https://developers.iagenify.com/zh/sdk/ref/mail/contacts/save/
Language: zh

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

创建或更改联系人。 照片会进入账户自己的存储, 并且会赢得发件人域内发现的任何信息 。

Status: creates or replaces · image: null keeps the name · counted in the quota

```javascript
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
```

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `address` | string | 必填 | 记者 钥匙 |
| `name` | string |  | 展示什么 |
| `image` | object|null |  | `{ data, type }`. `null` 将照片删除,其余的保留下来。 |

## 胜过域标 {#wins}

> **标志是公司标志;照片是个人**
>
> 这正是地址簿存在的原因。 域名对于一个组织是正确的,对一个人来说是错误的,对一个消费者来说,域名对每个组织来说都是供应商的标志。

## 字节是账户的字节 {#storage}

存放在物品储存库中,清单中可见,在配额中计为可删除,没有其它地方可以找到谁写信给客户。

## 替换相同的地址 {#replaces}

没有单独更新。 保存一个地址, 保存一个地址, 改变它, 忽略字段, 保持原样, 但 `image: null`刻意删除照片

## 一张新照片有新地址 {#new-address}

也就是过期缓存。旧缓存停止引用 。

- [remove()](/zh/sdk/ref/mail/contacts/remove): 正在删除 。
- [mailbox.update()](/zh/sdk/ref/mailbox/update): 一张自己地址的照片

```python
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
```
