# Update Contact

## Update Existing Contact Details

Fetch a specific contact's data in an inabit organization, according to the contact's ID.

By this endpoint, users can update an existing contact details in their organization.

```graphql
mutation UpdateContact($data: ContactUpdateInput!, $where: ContactWhereUniqueInput!) {
  updateContact(data: $data, where: $where) {
    id
    name
    contactCategory {
      id
      name
    }
    firstName
    lastName
    fullName
    email
    shouldNotifyTx
    phone
    phoneCountry {
      id
      phoneCode
    }
  }
}
```

### **Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

### Body (<mark style="color:orange;">ContactUpdateInput</mark>) object + (<mark style="color:orange;">ContactWhereUniqueInput</mark>) object

| Name                                 | Type   | Description          |
| ------------------------------------ | ------ | -------------------- |
| id<mark style="color:red;">\*</mark> | String | Organization ID      |
| id<mark style="color:red;">\*</mark> | String | Contact ID           |
| name                                 | String | Contact Name         |
| contactCategoryID                    | String | Contact's First Name |

Example body:

```json
{
  "data": {
    "organization": {
      "id": "cloh4qk1e0002dn01v9u2rfvh"
    },
    "name": "NEW Asher QA",
    "contactCategory": {
      "id": "cllurziwt006xgqjllg9x5grm"
    }
  },
  "where": {
    "id": "clph5roj900138f01ngzdkzdm"
  }
}
```

### Response

Return values:

| Name                     | Type   | Description                                                                                                                                                   |
| ------------------------ | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id                       | String | Organization ID                                                                                                                                               |
| name                     | String | Contact ID                                                                                                                                                    |
| id (contactCategoryID)   | String | Contact Name                                                                                                                                                  |
| name (contactCategoryID) | String | Contact's First Name                                                                                                                                          |
| firstName                | String | Contact First Name                                                                                                                                            |
| lastName                 | String | Contact Last Name                                                                                                                                             |
| fullName                 | String | Contact Full Name                                                                                                                                             |
| email                    | String | Contact Email                                                                                                                                                 |
| shouldNotifyTx           | String | <p>If true, send emails to this contact</p><p>for every transaction associated</p><p>with the contact's addresses</p><p><em>("walletCryptoAccounts")</em></p> |
| phone                    | String | Phone Number                                                                                                                                                  |
| id (phoneCountry)        | String | ID of the phoneCountry                                                                                                                                        |
| phoneCode (phoneCountry) | String | Phone Code of the phoneCountry                                                                                                                                |

{% tabs %}
{% tab title="🟢 Success" %}

```javascript
{
  "data": {
    "updateContact": {
      "id": "clph5roj900138f01ngzdkzdm",
      "name": "NEW Asher QA",
      "contactCategory": {
        "id": "cllurziwt006xgqjllg9x5grm",
        "name": "Marketing",
      },
      "firstName": "Asher",
      "lastName": "Indursky",
      "fullName": "Asher Indursky",
      "email": "asher@example.com",
      "shouldNotifyTx": true,
      "phone": "588080080",
      "phoneCountry": {
        "id": "cli023gmw005vlczi6pl7ck0w",
        "phoneCode": "+972",
      },
    }
  }
}

```

{% endtab %}

{% tab title="🔴 Failure" %}

{% endtab %}
{% endtabs %}

**How do I retrieve my organization ID?**

In order to retrieve an organization's identifier, you'll need to call your user details first, to understand which organization is related to them.

```graphql
query User($where: UserWhereUniqueInput!) {
  user(where: $where) {
    fullName
    organizations {
      name
      id
    }
  }
}
```

### Try it out!

{% embed url="<https://studio.apollographql.com/sandbox/explorer?endpoint=https://api.inabit.com/graphql&explorerURLState=N4IgJg9gxgrgtgUwHYBcQC4RxighigSwiQAIBVABzHwQGFi8oUAKAEmr3RPtVyco4IAkkgo4AhABoSrAO4ALBACcEXHoxQB1RSrJICARxjDREgJQlgAHVIkYVGur4sOuLu3y5pC5apk+VC2tbEhICMBtQ0KRcREioqAZnWhoAcwglAE9LeKiwiJComLjCgF9ckgAzAiUAZxQAOViECoAbXHqmkrzKmFbWrpbChDhcAlaK2vkIPrAGiEJKzIAVAA8KimmkIbzN4joZ1CycwtDwitC97fowHajy2wfSkEkQADdcJQJcACNWhFqGBAwVCVnAnjBXBBUTBGVSuH0AC98EQkJCTnlQSBzhgSGCoK0IPIACwGADWAEYEAAGWkAJjASGpFLeAE4YHSlJU3vIwRVSpIKmDii1cWCGgBRTQkACCU2UJAAijKwYLCvikkwUigEOksujoXkwTiuPj+jAlIiCLIULSAGyrVIGABW-VSrNWAFZUko4HyyvEBfEwQFRVChdiImKQATNp6lBBnazaRSAMwADkqzKQqURYDJeb9IEDNmer0UuFudSBfJALxAFAg9UqrQIqXkKAA8hRlCjiABlKBfChoTAgUpAA>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.inabit.com/api-reference/develop-with-inabit-api/contacts/update-contact.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
