# CRM — accounts & contacts

> Every account and contact query and mutation, plus saved views and custom fields.

Product: Clad API
Source: https://docs.useclad.ai/api/reference-crm

---

Read and write CRM accounts and contacts, saved account views, and account/contact custom fields.

### Queries

#### `account`

```graphql
account(id: ID!): Account
```

| Argument | Type | Description |
| --- | --- | --- |
| `id` | `ID!` | Required. |

#### `accounts`

```graphql
accounts(after: String, first: Int, search: String): AccountConnection
```

| Argument | Type | Description |
| --- | --- | --- |
| `after` | `String` |  |
| `first` | `Int` |  |
| `search` | `String` |  |

#### `accountViews`

```graphql
accountViews: [AccountView!]
```

Saved account views (filters) for the organization.

#### `contact`

```graphql
contact(id: ID!): Contact
```

| Argument | Type | Description |
| --- | --- | --- |
| `id` | `ID!` | Required. |

#### `contacts`

```graphql
contacts(accountId: ID, after: String, first: Int, search: String): ContactConnection
```

| Argument | Type | Description |
| --- | --- | --- |
| `accountId` | `ID` |  |
| `after` | `String` |  |
| `first` | `Int` |  |
| `search` | `String` |  |

#### `customFields`

```graphql
customFields(entity: CustomFieldEntity!): [CustomField!]
```

| Argument | Type | Description |
| --- | --- | --- |
| `entity` | `CustomFieldEntity!` | Required. |

### Mutations

#### `createAccount`

```graphql
createAccount(input: CreateAccountInput!): AccountResult
```

| Argument | Type | Description |
| --- | --- | --- |
| `input` | `CreateAccountInput!` | Required. |

#### `createAccountView`

```graphql
createAccountView(input: CreateAccountViewInput!): AccountViewResult
```

Create a saved account view (filter). The org's first view is auto-starred.

| Argument | Type | Description |
| --- | --- | --- |
| `input` | `CreateAccountViewInput!` | Required. |

#### `createContact`

```graphql
createContact(input: CreateContactInput!): ContactResult
```

| Argument | Type | Description |
| --- | --- | --- |
| `input` | `CreateContactInput!` | Required. |

#### `createCustomField`

```graphql
createCustomField(input: CreateCustomFieldInput!): CustomFieldResult
```

| Argument | Type | Description |
| --- | --- | --- |
| `input` | `CreateCustomFieldInput!` | Required. |

#### `deleteAccount`

```graphql
deleteAccount(id: ID!): DeleteAccountResult
```

Hard-delete a CRM account. Contacts keep existing; issues are not touched.

| Argument | Type | Description |
| --- | --- | --- |
| `id` | `ID!` | Required. |

#### `deleteAccountView`

```graphql
deleteAccountView(id: ID!): DeleteAccountViewResult
```

Delete a saved account view.

| Argument | Type | Description |
| --- | --- | --- |
| `id` | `ID!` | Required. |

#### `deleteContact`

```graphql
deleteContact(id: ID!): DeleteContactResult
```

Hard-delete a CRM contact.

| Argument | Type | Description |
| --- | --- | --- |
| `id` | `ID!` | Required. |

#### `deleteCustomField`

```graphql
deleteCustomField(input: DeleteCustomFieldInput!): DeleteCustomFieldResult
```

| Argument | Type | Description |
| --- | --- | --- |
| `input` | `DeleteCustomFieldInput!` | Required. |

#### `updateAccount`

```graphql
updateAccount(input: UpdateAccountInput!): AccountResult
```

| Argument | Type | Description |
| --- | --- | --- |
| `input` | `UpdateAccountInput!` | Required. |

#### `updateAccountView`

```graphql
updateAccountView(input: UpdateAccountViewInput!): AccountViewResult
```

Rename, reconfigure, or star/unstar a saved account view.

| Argument | Type | Description |
| --- | --- | --- |
| `input` | `UpdateAccountViewInput!` | Required. |

#### `updateContact`

```graphql
updateContact(input: UpdateContactInput!): ContactResult
```

| Argument | Type | Description |
| --- | --- | --- |
| `input` | `UpdateContactInput!` | Required. |

#### `updateCustomField`

```graphql
updateCustomField(input: UpdateCustomFieldInput!): CustomFieldResult
```

| Argument | Type | Description |
| --- | --- | --- |
| `input` | `UpdateCustomFieldInput!` | Required. |
