# add_contact

**Add a contact to a group**

Users with access to a group

Adds one contact to a group, with its fields, note and photo, for people with add access on the group. Contacts live only in groups, never in a directory itself, so every add names one: pick it from [`my_access`](https://withopenbook.com/docs/tools/my_access), and ask when it isn’t clear which. Your own directory’s groups take adds like any group, but By Request, which holds only contacts people shared with you; the people you know go in with [`add_to_private_contacts`](https://withopenbook.com/docs/tools/add_to_private_contacts). A mobile number the directory already has waits for an owner. Put each number, email, address and link in fields, labeled for what it is (phone mobile, home, work, main or other; email home, work, school or other), never in the note or the name. Its note is for everyone the groups’ Notes rule shows notes to, so put everything people should know about the contact there as you add it; note_only_you is for what’s for the user alone. A photo is a field, { type: "photo", value: a JPEG or PNG as base64, or an https link to one, up to 15 MB }, or a photo the user attached in ChatGPT, as photo_file; Openbook fetches a link only from the public internet and keeps the photo with its location taken out.

## Parameters

| Parameter | Type | Required | Limits | What |
|---|---|---|---|---|
| `group` | `string` | required |  |  |
| `contact` | `object` | required |  |  |
| `contact.name` | `string` | required |  |  |
| `contact.fields` | `{ type: "phone" \| "email" \| "address" \| "url" \| "birthday" \| "company" \| "title" \| "note" \| "social" \| "photo", label?: string, value: string }[]` | required |  |  |
| `contact.note` | `string` | optional |  | What people should know about the contact that no field holds, like who recommended them and why, for everyone the groups’ Notes rule shows notes to, as [`add_note`](https://withopenbook.com/docs/tools/add_note) adds one. Give everything you know here when adding. |
| `contact.note_only_you` | `string` | optional |  | A note only you see, never anyone else, owners included (D46): only what’s for the user alone. |
| `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 its photo. |

## 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.

## 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/add_contact \
  -H "Authorization: Bearer $OPENBOOK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "group": "a1c4e7f0-2b5d-4c8e-9f1a-3b6d9e2c5f80",
  "contact": {
    "name": "Hana Sato",
    "fields": [
      {
        "type": "phone",
        "label": "mobile",
        "value": "(415) 555-0142"
      },
      {
        "type": "email",
        "label": "home",
        "value": "hana.sato@example.com"
      }
    ]
  }
}'
```

MCP:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "add_contact",
    "arguments": {
      "group": "a1c4e7f0-2b5d-4c8e-9f1a-3b6d9e2c5f80",
      "contact": {
        "name": "Hana Sato",
        "fields": [
          {
            "type": "phone",
            "label": "mobile",
            "value": "(415) 555-0142"
          },
          {
            "type": "email",
            "label": "home",
            "value": "hana.sato@example.com"
          }
        ]
      }
    }
  }
}
```

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