# PUT /api/auth/profile

Canonical URL: https://developers.iagenify.com/zh/api/auth/profile/
Language: zh

`PUT https://api.iagenify.com/api/auth/profile`

更新认证账户的配置文件字段。请求中遗漏的字段保持不变。

Status: Bearer 或 API 密钥 · JSON · 修改账户

## HTTP 请求 {#http}

```bash
curl https://api.iagenify.com/api/auth/profile \
  -X PUT \
  -H "Authorization: Bearer $IAGENIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"prenom":"Ada","nom":"Lovelace","ville":"London"}'
```

## JavaScript {#javascript}

```javascript
const response = await fetch("https://api.iagenify.com/api/auth/profile", {
  method: "PUT",
  headers: { Authorization: `Bearer ${process.env.IAGENIFY_TOKEN}`, "Content-Type": "application/json" },
  body: JSON.stringify({
  "prenom": "Ada",
  "nom": "Lovelace",
  "ville": "London"
}),
});
const result = await response.json();
if (!response.ok) throw new Error(result.error);
```

## Python {#python}

```python
import os, requests

response = requests.request(
    "PUT",
    "https://api.iagenify.com/api/auth/profile",
    headers={"Authorization": "Bearer " + os.environ["IAGENIFY_TOKEN"]},
    json={
  "prenom": "Ada",
  "nom": "Lovelace",
  "ville": "London"
},
    timeout=30,
)
response.raise_for_status()
result = response.json()
```

## 请求体 {#body}

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `nom` | string |  | 姓 姓 姓 姓 姓 姓 姓 姓 姓 |
| `prenom` | string |  | 名声 |
| `genre` | string |  | 性别价值简介。 |
| `tel` | string |  | 电话号码。 |
| `adresse` | string |  | 邮政地址。 |
| `ville` | string |  | 城市 |

## 成功响应 {#response}

```javascript
{ ok: true, user: { id: "…", prenom: "Ada", nom: "Lovelace" } }
```

> **只发送有意更改**
>
> 空值会被此端点忽略。 当仅编辑一个字段时, 不要发送整个缓存配置 。

> **密码不是公开的 API 操作操作操作**
>
> 使用签名的账户设置更改密码。 `password` 在这里返回返回 `403 password_change_private`.
