# update_contact

**Change contacts’ details**

Users with access to a group · destructive

Changes, adds or takes off values on contacts, like a number, an email, an address, a link, a birthday or a photo, for people with edit access on each contact. edits holds up to 500 contacts, each with its changes, so one call changes them all; every edit is checked first, and one that can’t be made refuses the whole call, naming it. Changes apply across the directory. A number, email, address or link a contact lacks is added here as a field, never written into a note; a label is what the value is, like mobile or work; to relabel one, take it off under the label it has (value null, was naming it) and add it again under the new one; to add a second email or number beside one with the same label, give was: null. A contact’s photo is a field like any other, { type: "photo" }, whose value is a JPEG or PNG as base64 or an https link to one, up to 15 MB, which Openbook fetches only from the public internet, or null to take it off; it reads back as a hash, and each group’s rule for photo decides who sees it. A photo the user attached in ChatGPT goes in photo_file, with one edit. Answers with how many contacts changed.

## Parameters

| Parameter | Type | Required | Limits | What |
|---|---|---|---|---|
| `edits` | `{ contact: string, changes: { field: { type: "phone" \| "email" \| "address" \| "url" \| "birthday" \| "company" \| "title" \| "note" \| "social" \| "photo", label?: string }, value: string or null, was?: string or null }[] }[]` | required | at least 1, up to 500 |  |
| `photo_file` | `{ download_url: string, file_id: string, mime_type?: string, file_name?: string }` | optional |  | A photo of the contact the user attached in ChatGPT, which becomes the photo of the one contact in edits. |

## Who can use it

Users get it once they have access to a group, and each call is checked against that access. A person’s tool list only includes it when they can use it, and clients like ChatGPT see the same list.

Annotated **destructive**, so clients like ChatGPT ask the person before calling it.

## Errors

Errors carry a stable code and a message written for people. See [errors and their status codes](https://withopenbook.com/docs/api#errors).

HTTP:

```bash
curl https://api.withopenbook.com/v1/actions/update_contact \
  -H "Authorization: Bearer $OPENBOOK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "edits": [
    {
      "contact": "5e8b2d4f-7a1c-4e9b-8d3f-6c2a9e1b4d70",
      "changes": [
        {
          "field": {
            "type": "email",
            "label": "home"
          },
          "value": "hana@example.com"
        }
      ]
    }
  ]
}'
```

MCP:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "update_contact",
    "arguments": {
      "edits": [
        {
          "contact": "5e8b2d4f-7a1c-4e9b-8d3f-6c2a9e1b4d70",
          "changes": [
            {
              "field": {
                "type": "email",
                "label": "home"
              },
              "value": "hana@example.com"
            }
          ]
        }
      ]
    }
  }
}
```

> IDs are made up. Get real ones from `my_access` and `search_contacts`, and send the person’s own OAuth token.
