> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corsair.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# API

> API reference for AgencyZoom: every `agencyzoom.api.*` operation with input and output types.

Every `agencyzoom.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas.

<Info>
  **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling).
</Info>

## Auth

### logTheUserIn

`auth.logTheUserIn`

Authenticates an existing AgencyZoom user using their email (as username) and password to obtain a JWT for API access; this action does not support new user creation.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.auth.logTheUserIn({});
```

**Input**

| Name       | Type     | Required | Description |
| ---------- | -------- | -------- | ----------- |
| `password` | `string` | Yes      | —           |
| `username` | `string` | Yes      | —           |
| `body`     | `any`    | No       | —           |
| `query`    | `object` | No       | —           |
| `headers`  | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output**

| Name         | Type      | Required | Description |
| ------------ | --------- | -------- | ----------- |
| `jwt`        | `string`  | Yes      | —           |
| `ownerAgent` | `boolean` | No       | —           |

***

### logTheUserOut

`auth.logTheUserOut`

Use this action to log the current user out of AgencyZoom by invalidating their active session token. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not |

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.auth.logTheUserOut({});
```

**Input**

| Name      | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `body`    | `any`    | No       | —           |
| `query`   | `object` | No       | —           |
| `headers` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### v4SsoLogTheUserIn

`auth.v4SsoLogTheUserIn`

Logs a user into the AgencyZoom platform via Single Sign-On (SSO). Returns JWT on success or error details on authentication failure.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.auth.v4SsoLogTheUserIn({});
```

**Input**

| Name       | Type     | Required | Description |
| ---------- | -------- | -------- | ----------- |
| `password` | `string` | Yes      | —           |
| `username` | `string` | Yes      | —           |
| `body`     | `any`    | No       | —           |
| `query`    | `object` | No       | —           |
| `headers`  | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output**

| Name         | Type      | Required | Description |
| ------------ | --------- | -------- | ----------- |
| `jwt`        | `string`  | Yes      | —           |
| `ownerAgent` | `boolean` | No       | —           |

***

## Contact

### batchCreateContact

`contact.batchCreateContact`

Creates 1 to 5 new contacts in AgencyZoom in a single batch API call.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.contact.batchCreateContact({});
```

**Input**

| Name                  | Type     | Required | Description |
| --------------------- | -------- | -------- | ----------- |
| `contactDataRequests` | `any[]`  | Yes      | —           |
| `body`                | `any`    | No       | —           |
| `query`               | `object` | No       | —           |
| `headers`             | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

## Customers

### createACustomerNote

`customers.createACustomerNote`

Adds a new note to an existing customer's profile using their ID; cannot be used to edit or retrieve existing notes.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.customers.createACustomerNote({});
```

**Input**

| Name         | Type     | Required | Description |
| ------------ | -------- | -------- | ----------- |
| `note`       | `string` | Yes      | —           |
| `customerId` | `number` | Yes      | —           |
| `body`       | `any`    | No       | —           |
| `query`      | `object` | No       | —           |
| `headers`    | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### deleteACustomer

`customers.deleteACustomer`

Irreversibly deletes a customer and all associated data in AgencyZoom using their `customerId`; useful for offboarding or data privacy compliance.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.agencyzoom.api.customers.deleteACustomer({});
```

**Input**

| Name         | Type     | Required | Description |
| ------------ | -------- | -------- | ----------- |
| `customerId` | `number` | Yes      | —           |
| `body`       | `any`    | No       | —           |
| `query`      | `object` | No       | —           |
| `headers`    | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### deleteACustomerFile

`customers.deleteACustomerFile`

Permanently deletes a specific file, identified by `fileId`, associated with a customer, identified by `customerId`.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.agencyzoom.api.customers.deleteACustomerFile({});
```

**Input**

| Name         | Type     | Required | Description |
| ------------ | -------- | -------- | ----------- |
| `fileId`     | `number` | Yes      | —           |
| `customerId` | `number` | Yes      | —           |
| `body`       | `any`    | No       | —           |
| `query`      | `object` | No       | —           |
| `headers`    | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### deleteACustomerPolicy

`customers.deleteACustomerPolicy`

Permanently deletes a specific policy associated with a customer, for instance, if it's cancelled or inactive; this action is irreversible and requires caution.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.agencyzoom.api.customers.deleteACustomerPolicy({});
```

**Input**

| Name         | Type     | Required | Description |
| ------------ | -------- | -------- | ----------- |
| `policyId`   | `number` | Yes      | —           |
| `customerId` | `number` | Yes      | —           |
| `body`       | `any`    | No       | —           |
| `query`      | `object` | No       | —           |
| `headers`    | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### getAmsPoliciesForACustomer

`customers.getAmsPoliciesForACustomer`

Retrieves a customer's synchronized Agency Management System (AMS) policy data (typically a single policy); requires an active AMS integration, may return empty/default values if data is missing.

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.customers.getAmsPoliciesForACustomer({});
```

**Input**

| Name         | Type     | Required | Description |
| ------------ | -------- | -------- | ----------- |
| `customerId` | `number` | Yes      | —           |
| `body`       | `any`    | No       | —           |
| `query`      | `object` | No       | —           |
| `headers`    | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### getPoliciesForACustomer

`customers.getPoliciesForACustomer`

Retrieves from AgencyZoom all insurance policies for an existing customer (identified by `customerId`), including policy details like type, carrier, premium, effective dates, and assigned agents. Excludes premium payment history or claims information.

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.customers.getPoliciesForACustomer({});
```

**Input**

| Name         | Type     | Required | Description |
| ------------ | -------- | -------- | ----------- |
| `customerId` | `number` | Yes      | —           |
| `body`       | `any`    | No       | —           |
| `query`      | `object` | No       | —           |
| `headers`    | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### getTheCustomerDetails

`customers.getTheCustomerDetails`

Fetches comprehensive details for a specific customer, including personal information, policies, notes, tasks, files, and custom fields, using their unique customer ID.

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.customers.getTheCustomerDetails({});
```

**Input**

| Name         | Type     | Required | Description |
| ------------ | -------- | -------- | ----------- |
| `customerId` | `number` | Yes      | —           |
| `body`       | `any`    | No       | —           |
| `query`      | `object` | No       | —           |
| `headers`    | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output**

| Name           | Type               | Required | Description |
| -------------- | ------------------ | -------- | ----------- |
| `id`           | `string \| number` | No       | —           |
| `businessName` | `string`           | No       | —           |
| `firstname`    | `string`           | No       | —           |
| `lastname`     | `string`           | No       | —           |
| `email`        | `string`           | No       | —           |
| `phone`        | `string`           | No       | —           |
| `customerType` | `string`           | No       | —           |

***

### getTheCustomerTasks

`customers.getTheCustomerTasks`

Fetches all tasks (read-only task data) for a customer by `customerId` to review their activities, follow-ups, and action items; the `customerId` must be valid.

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.customers.getTheCustomerTasks({});
```

**Input**

| Name         | Type     | Required | Description |
| ------------ | -------- | -------- | ----------- |
| `customerId` | `number` | Yes      | —           |
| `body`       | `any`    | No       | —           |
| `query`      | `object` | No       | —           |
| `headers`    | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### searchCustomers

`customers.searchCustomers`

Searches for customers in AgencyZoom using criteria like contact information, policy details, or custom fields, with options for filtering, sorting, and pagination. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not |

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.customers.searchCustomers({});
```

**Input**

| Name       | Type     | Required | Description |
| ---------- | -------- | -------- | ----------- |
| `page`     | `number` | No       | —           |
| `pageSize` | `number` | No       | —           |
| `sort`     | `string` | No       | —           |
| `order`    | `string` | No       | —           |
| `location` | `string` | No       | —           |
| `body`     | `any`    | No       | —           |
| `query`    | `object` | No       | —           |
| `headers`  | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### updateCustomer

`customers.updateCustomer`

Updates an existing customer's information in AgencyZoom using their unique customerId.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.customers.updateCustomer({});
```

**Input**

| Name                | Type     | Required | Description |
| ------------------- | -------- | -------- | ----------- |
| `zip`               | `string` | No       | —           |
| `city`              | `string` | No       | —           |
| `csrId`             | `number` | No       | —           |
| `email`             | `string` | No       | —           |
| `phone`             | `string` | No       | —           |
| `state`             | `string` | No       | —           |
| `agentId`           | `number` | No       | —           |
| `country`           | `string` | No       | —           |
| `birthday`          | `string` | No       | —           |
| `lastname`          | `string` | No       | —           |
| `tagNames`          | `string` | No       | —           |
| `firstname`         | `string` | No       | —           |
| `createDate`        | `string` | No       | —           |
| `customerId`        | `number` | Yes      | —           |
| `bizCustomer`       | `number` | No       | —           |
| `customFields`      | `any[]`  | No       | —           |
| `totalPayroll`      | `number` | No       | —           |
| `annualRevenue`     | `number` | No       | —           |
| `streetAddress`     | `string` | No       | —           |
| `secondaryEmail`    | `string` | No       | —           |
| `secondaryPhone`    | `string` | No       | —           |
| `contactLastname`   | `string` | No       | —           |
| `contactFirstname`  | `string` | No       | —           |
| `contactMiddlename` | `string` | No       | —           |
| `numberOfEmployees` | `number` | No       | —           |
| `body`              | `any`    | No       | —           |
| `query`             | `object` | No       | —           |
| `headers`           | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output**

| Name           | Type               | Required | Description |
| -------------- | ------------------ | -------- | ----------- |
| `id`           | `string \| number` | No       | —           |
| `businessName` | `string`           | No       | —           |
| `firstname`    | `string`           | No       | —           |
| `lastname`     | `string`           | No       | —           |
| `email`        | `string`           | No       | —           |
| `phone`        | `string`           | No       | —           |
| `customerType` | `string`           | No       | —           |

***

## Email Threads

### deleteMessage

`emailThreads.deleteMessage`

Deletes a specific message from an email thread within AgencyZoom. Requires the message ID to identify which message to remove. Returns the updated thread information with the remaining messages after deletion.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.agencyzoom.api.emailThreads.deleteMessage({});
```

**Input**

| Name        | Type     | Required | Description |
| ----------- | -------- | -------- | ----------- |
| `messageId` | `string` | Yes      | —           |
| `page`      | `number` | No       | —           |
| `pageSize`  | `number` | No       | —           |
| `sort`      | `string` | No       | —           |
| `order`     | `string` | No       | —           |
| `location`  | `string` | No       | —           |
| `body`      | `any`    | No       | —           |
| `query`     | `object` | No       | —           |
| `headers`   | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### deleteThread

`emailThreads.deleteThread`

Permanently deletes a specific email thread from the AgencyZoom system, identified by its `threadId` (expected by the endpoint), provided the thread exists.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.agencyzoom.api.emailThreads.deleteThread({});
```

**Input**

| Name       | Type     | Required | Description |
| ---------- | -------- | -------- | ----------- |
| `threadId` | `string` | Yes      | —           |
| `page`     | `number` | No       | —           |
| `pageSize` | `number` | No       | —           |
| `sort`     | `string` | No       | —           |
| `order`    | `string` | No       | —           |
| `location` | `string` | No       | —           |
| `body`     | `any`    | No       | —           |
| `query`    | `object` | No       | —           |
| `headers`  | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### getThreadDetails

`emailThreads.getThreadDetails`

Searches and retrieves detailed information for email threads in AgencyZoom; no explicit search criteria are passed in this request. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not |

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.emailThreads.getThreadDetails({});
```

**Input**

| Name          | Type     | Required | Description |
| ------------- | -------- | -------- | ----------- |
| `page`        | `number` | No       | —           |
| `pageSize`    | `number` | No       | —           |
| `sort`        | `string` | No       | —           |
| `order`       | `string` | No       | —           |
| `location`    | `string` | No       | —           |
| `threadId`    | `string` | No       | —           |
| `searchTerm`  | `string` | No       | —           |
| `status`      | `number` | No       | —           |
| `lastDateUTC` | `string` | No       | —           |
| `body`        | `any`    | No       | —           |
| `query`       | `object` | No       | —           |
| `headers`     | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### markThreadAsUnreadApiEndpoint

`emailThreads.markThreadAsUnreadApiEndpoint`

Marks an email thread in AgencyZoom as read or unread using its `threadId`; this action does not modify message content and the specified `threadId` must refer to an existing thread.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.emailThreads.markThreadAsUnreadApiEndpoint({});
```

**Input**

| Name         | Type      | Required | Description |
| ------------ | --------- | -------- | ----------- |
| `threadId`   | `string`  | Yes      | —           |
| `markUnread` | `boolean` | Yes      | —           |
| `body`       | `any`     | No       | —           |
| `query`      | `object`  | No       | —           |
| `headers`    | `object`  | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### searchEmailThreads

`emailThreads.searchEmailThreads`

Retrieves a list of email thread metadata from AgencyZoom, suitable for an overview when no specific filtering, sorting, or pagination is needed, as results are subject to default server-side limits and ordering. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not |

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.emailThreads.searchEmailThreads({});
```

**Input**

| Name       | Type     | Required | Description |
| ---------- | -------- | -------- | ----------- |
| `page`     | `number` | No       | —           |
| `pageSize` | `number` | No       | —           |
| `sort`     | `string` | No       | —           |
| `order`    | `string` | No       | —           |
| `location` | `string` | No       | —           |
| `body`     | `any`    | No       | —           |
| `query`    | `object` | No       | —           |
| `headers`  | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

## Leads

### batchCreateLead

`leads.batchCreateLead`

Creates up to 5 new leads in AgencyZoom; all referenced entity IDs (e.g., pipeline, user, custom field names) must exist, and organization `name` is required if `isBusiness` is true.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.leads.batchCreateLead({});
```

**Input**

| Name               | Type     | Required | Description |
| ------------------ | -------- | -------- | ----------- |
| `leadDataRequests` | `any[]`  | Yes      | —           |
| `body`             | `any`    | No       | —           |
| `query`            | `object` | No       | —           |
| `headers`          | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### changeStatusForLead

`leads.changeStatusForLead`

Updates a lead's lifecycle status (e.g., Active, Won, Lost, X-Dated) and can optionally manage its workflow, pipeline, stage, source, or associated tags.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.leads.changeStatusForLead({});
```

**Input**

| Name                 | Type     | Required | Description |
| -------------------- | -------- | -------- | ----------- |
| `date`               | `string` | No       | —           |
| `leadId`             | `number` | Yes      | —           |
| `status`             | `number` | Yes      | —           |
| `tagIds`             | `any[]`  | No       | —           |
| `toStageId`          | `number` | No       | —           |
| `xDateType`          | `string` | No       | —           |
| `workflowId`         | `number` | No       | —           |
| `lossReasonId`       | `number` | No       | —           |
| `recycleToStage`     | `number` | No       | —           |
| `workflowStageId`    | `number` | No       | —           |
| `recycleToPipeline`  | `number` | No       | —           |
| `changeLeadSourceTo` | `number` | No       | —           |
| `body`               | `any`    | No       | —           |
| `query`              | `object` | No       | —           |
| `headers`            | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### createALeadNote

`leads.createALeadNote`

Adds a new note to an existing lead in AgencyZoom, identified by `leadId`.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.leads.createALeadNote({});
```

**Input**

| Name      | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `note`    | `string` | Yes      | —           |
| `leadId`  | `number` | Yes      | —           |
| `body`    | `any`    | No       | —           |
| `query`   | `object` | No       | —           |
| `headers` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### createALeadOpportunity

`leads.createALeadOpportunity`

Adds a new sales opportunity to an existing lead in AgencyZoom, requiring a valid `leadId`, `carrierId`, `productLineId`, and that custom field names match existing definitions in AgencyZoom.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.leads.createALeadOpportunity({});
```

**Input**

| Name            | Type     | Required | Description |
| --------------- | -------- | -------- | ----------- |
| `items`         | `number` | No       | —           |
| `leadId`        | `number` | Yes      | —           |
| `premium`       | `number` | Yes      | —           |
| `carrierId`     | `number` | Yes      | —           |
| `customFields`  | `any[]`  | No       | —           |
| `productLineId` | `number` | Yes      | —           |
| `body`          | `any`    | No       | —           |
| `query`         | `object` | No       | —           |
| `headers`       | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### createALeadQuote

`leads.createALeadQuote`

Creates a new insurance quote for an existing lead in AgencyZoom, using valid carrier and product line IDs, to track a proposal; this action does not bind policies or process payments.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.leads.createALeadQuote({});
```

**Input**

| Name            | Type     | Required | Description |
| --------------- | -------- | -------- | ----------- |
| `items`         | `number` | Yes      | —           |
| `leadId`        | `number` | Yes      | —           |
| `premium`       | `number` | Yes      | —           |
| `carrierId`     | `number` | Yes      | —           |
| `customFields`  | `any[]`  | No       | —           |
| `productLineId` | `number` | Yes      | —           |
| `body`          | `any`    | No       | —           |
| `query`         | `object` | No       | —           |
| `headers`       | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### createBizLead

`leads.createBizLead`

Creates or updates a business lead in AgencyZoom using detailed personal and company information, for B2B sales and marketing lead management.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.leads.createBizLead({});
```

**Input**

| Name                          | Type     | Required | Description |
| ----------------------------- | -------- | -------- | ----------- |
| `dba`                         | `string` | No       | —           |
| `fax`                         | `string` | No       | —           |
| `zip`                         | `string` | No       | —           |
| `city`                        | `string` | No       | —           |
| `fein`                        | `string` | No       | —           |
| `name`                        | `string` | Yes      | —           |
| `csrId`                       | `number` | No       | —           |
| `email`                       | `string` | Yes      | —           |
| `notes`                       | `string` | No       | —           |
| `phone`                       | `string` | No       | —           |
| `state`                       | `string` | No       | —           |
| `xDate`                       | `string` | No       | —           |
| `country`                     | `string` | Yes      | —           |
| `payroll`                     | `string` | No       | —           |
| `stageId`                     | `number` | Yes      | —           |
| `assignTo`                    | `string` | Yes      | —           |
| `lastname`                    | `string` | No       | —           |
| `soldDate`                    | `string` | No       | —           |
| `tagNames`                    | `string` | No       | —           |
| `firstname`                   | `string` | Yes      | —           |
| `groupCode`                   | `string` | No       | —           |
| `otherCsrs`                   | `any[]`  | No       | —           |
| `quoteDate`                   | `string` | No       | —           |
| `middlename`                  | `string` | No       | —           |
| `pipelineId`                  | `number` | Yes      | —           |
| `contactDate`                 | `string` | No       | —           |
| `agencyNumber`                | `string` | No       | —           |
| `customFields`                | `any[]`  | No       | —           |
| `leadSourceId`                | `number` | Yes      | —           |
| `annualRevenue`               | `string` | No       | —           |
| `streetAddress`               | `string` | No       | —           |
| `departmentCode`              | `string` | No       | —           |
| `otherProducers`              | `any[]`  | No       | —           |
| `secondaryEmail`              | `string` | No       | —           |
| `secondaryPhone`              | `string` | No       | —           |
| `assignmentGroupId`           | `number` | No       | —           |
| `numberOfEmployees`           | `number` | No       | —           |
| `nextExpirationDate`          | `string` | No       | —           |
| `streetAddressLine2`          | `string` | No       | —           |
| `yearBusinessStarted`         | `string` | No       | —           |
| `businessClassification`      | `number` | No       | —           |
| `yearsOfManagementExperience` | `number` | No       | —           |
| `body`                        | `any`    | No       | —           |
| `query`                       | `object` | No       | —           |
| `headers`                     | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### createLead

`leads.createLead`

Creates a new lead or updates an existing one in AgencyZoom; ensure `pipelineId`, `stageId`, `leadSourceId`, and `assignTo` reference valid, existing entities.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.leads.createLead({});
```

**Input**

| Name                 | Type      | Required | Description |
| -------------------- | --------- | -------- | ----------- |
| `zip`                | `string`  | No       | —           |
| `city`               | `string`  | No       | —           |
| `name`               | `string`  | No       | —           |
| `csrId`              | `number`  | No       | —           |
| `email`              | `string`  | Yes      | —           |
| `notes`              | `string`  | No       | —           |
| `phone`              | `string`  | No       | —           |
| `state`              | `string`  | No       | —           |
| `xDate`              | `string`  | No       | —           |
| `country`            | `string`  | Yes      | —           |
| `stageId`            | `number`  | Yes      | —           |
| `assignTo`           | `string`  | Yes      | —           |
| `birthday`           | `string`  | No       | —           |
| `lastname`           | `string`  | No       | —           |
| `nickname`           | `string`  | No       | —           |
| `soldDate`           | `string`  | No       | —           |
| `tagNames`           | `string`  | No       | —           |
| `firstname`          | `string`  | Yes      | —           |
| `groupCode`          | `string`  | No       | —           |
| `otherCsrs`          | `any[]`   | No       | —           |
| `quoteDate`          | `string`  | No       | —           |
| `isBusiness`         | `boolean` | No       | —           |
| `middlename`         | `string`  | No       | —           |
| `pipelineId`         | `number`  | Yes      | —           |
| `contactDate`        | `string`  | No       | —           |
| `agencyNumber`       | `string`  | No       | —           |
| `customFields`       | `any[]`   | No       | —           |
| `leadSourceId`       | `number`  | Yes      | —           |
| `maritalStatus`      | `number`  | No       | —           |
| `streetAddress`      | `string`  | No       | —           |
| `departmentCode`     | `string`  | No       | —           |
| `otherProducers`     | `any[]`   | No       | —           |
| `secondaryEmail`     | `string`  | No       | —           |
| `secondaryPhone`     | `string`  | No       | —           |
| `assignmentGroupId`  | `number`  | No       | —           |
| `nextExpirationDate` | `string`  | No       | —           |
| `streetAddressLine2` | `string`  | No       | —           |
| `body`               | `any`     | No       | —           |
| `query`              | `object`  | No       | —           |
| `headers`            | `object`  | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output**

| Name           | Type               | Required | Description |
| -------------- | ------------------ | -------- | ----------- |
| `id`           | `string \| number` | No       | —           |
| `firstname`    | `string`           | No       | —           |
| `middlename`   | `string`           | No       | —           |
| `lastname`     | `string`           | No       | —           |
| `email`        | `string`           | No       | —           |
| `phone`        | `string`           | No       | —           |
| `status`       | `string \| number` | No       | —           |
| `leadSourceId` | `number`           | No       | —           |
| `pipelineId`   | `number`           | No       | —           |
| `stageId`      | `number`           | No       | —           |

***

### deleteALeadFile

`leads.deleteALeadFile`

Deletes a specific file (identified by `fileId`) associated with an existing lead (identified by `leadId`); this operation is irreversible.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.agencyzoom.api.leads.deleteALeadFile({});
```

**Input**

| Name      | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `fileId`  | `number` | Yes      | —           |
| `leadId`  | `number` | Yes      | —           |
| `body`    | `any`    | No       | —           |
| `query`   | `object` | No       | —           |
| `headers` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### deleteALeadOpportunity

`leads.deleteALeadOpportunity`

Permanently deletes an existing opportunity (by `opportunityId`) associated with an existing lead (by `leadId`) when it's irrelevant, closed, or erroneous; the lead itself remains.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.agencyzoom.api.leads.deleteALeadOpportunity({});
```

**Input**

| Name            | Type     | Required | Description |
| --------------- | -------- | -------- | ----------- |
| `leadId`        | `number` | Yes      | —           |
| `opportunityId` | `number` | Yes      | —           |
| `body`          | `any`    | No       | —           |
| `query`         | `object` | No       | —           |
| `headers`       | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### deleteALeadQuote

`leads.deleteALeadQuote`

Deletes a specific quote from a lead, requiring that the lead and quote exist and are associated.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.agencyzoom.api.leads.deleteALeadQuote({});
```

**Input**

| Name      | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `leadId`  | `number` | Yes      | —           |
| `quoteId` | `number` | Yes      | —           |
| `body`    | `any`    | No       | —           |
| `query`   | `object` | No       | —           |
| `headers` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### getLeadFiles

`leads.getLeadFiles`

Retrieves metadata (id, title, MIME type, size, dates, creator info) for files attached to leads in AgencyZoom. Optionally filter by `leadId` to get files for a specific lead, or omit to retrieve files across all leads. Returns file metadata only, not the actual file content.

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.leads.getLeadFiles({});
```

**Input**

| Name                 | Type     | Required | Description |
| -------------------- | -------- | -------- | ----------- |
| `page`               | `number` | No       | —           |
| `pageSize`           | `number` | No       | —           |
| `sort`               | `string` | No       | —           |
| `order`              | `string` | No       | —           |
| `location`           | `string` | No       | —           |
| `leadId`             | `number` | No       | —           |
| `fileType`           | `number` | No       | —           |
| `customerReferralId` | `number` | No       | —           |
| `body`               | `any`    | No       | —           |
| `query`              | `object` | No       | —           |
| `headers`            | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### getLeadNotes

`leads.getLeadNotes`

Fetches the complete history of notes for a specific lead by `leadId` (which must exist), useful for reviewing context for communications or follow-ups; this is a read-only operation.

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.leads.getLeadNotes({});
```

**Input**

| Name      | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `leadId`  | `number` | Yes      | —           |
| `body`    | `any`    | No       | —           |
| `query`   | `object` | No       | —           |
| `headers` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### getLeadQuotes

`leads.getLeadQuotes`

Retrieves all insurance quotes (active and inactive) for a specific lead ID, useful for reviewing or tracking quote history.

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.leads.getLeadQuotes({});
```

**Input**

| Name      | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `leadId`  | `number` | Yes      | —           |
| `body`    | `any`    | No       | —           |
| `query`   | `object` | No       | —           |
| `headers` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### getLeadTasks

`leads.getLeadTasks`

Retrieves all tasks for a specific lead, identified by its `leadId`, to review its activity history or manage follow-ups.

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.leads.getLeadTasks({});
```

**Input**

| Name      | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `leadId`  | `number` | Yes      | —           |
| `body`    | `any`    | No       | —           |
| `query`   | `object` | No       | —           |
| `headers` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### getTheLeadDetails

`leads.getTheLeadDetails`

Retrieves comprehensive details for a specific lead in AgencyZoom by its unique `leadId` (which must correspond to an existing lead), including contact information, status, associated opportunities, quotes/policies, custom fields, and interaction history.

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.leads.getTheLeadDetails({});
```

**Input**

| Name      | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `leadId`  | `number` | Yes      | —           |
| `body`    | `any`    | No       | —           |
| `query`   | `object` | No       | —           |
| `headers` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output**

| Name           | Type               | Required | Description |
| -------------- | ------------------ | -------- | ----------- |
| `id`           | `string \| number` | No       | —           |
| `firstname`    | `string`           | No       | —           |
| `middlename`   | `string`           | No       | —           |
| `lastname`     | `string`           | No       | —           |
| `email`        | `string`           | No       | —           |
| `phone`        | `string`           | No       | —           |
| `status`       | `string \| number` | No       | —           |
| `leadSourceId` | `number`           | No       | —           |
| `pipelineId`   | `number`           | No       | —           |
| `stageId`      | `number`           | No       | —           |

***

### getTheOpportunitiesForALead

`leads.getTheOpportunitiesForALead`

Retrieves all sales opportunities and their details for a specified, existing `leadId` in AgencyZoom.

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.leads.getTheOpportunitiesForALead({});
```

**Input**

| Name      | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `leadId`  | `number` | Yes      | —           |
| `body`    | `any`    | No       | —           |
| `query`   | `object` | No       | —           |
| `headers` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### moveLeadToSold

`leads.moveLeadToSold`

Marks an existing lead as sold by its `leadId` and records product details; `productLineId`, `premium`, `effectiveDate`, and `soldDate` are operationally required for each sold product, despite schema flexibility.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.leads.moveLeadToSold({});
```

**Input**

| Name           | Type      | Required | Description |
| -------------- | --------- | -------- | ----------- |
| `leadId`       | `number`  | Yes      | —           |
| `keepOpen`     | `boolean` | No       | —           |
| `soldProducts` | `any[]`   | Yes      | —           |
| `body`         | `any`     | No       | —           |
| `query`        | `object`  | No       | —           |
| `headers`      | `object`  | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### searchLeads

`leads.searchLeads`

Retrieves AgencyZoom leads, using filters, pagination, and sorting options sent in the POST body, as the request schema itself is empty. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not |

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.leads.searchLeads({});
```

**Input**

| Name       | Type     | Required | Description |
| ---------- | -------- | -------- | ----------- |
| `page`     | `number` | No       | —           |
| `pageSize` | `number` | No       | —           |
| `sort`     | `string` | No       | —           |
| `order`    | `string` | No       | —           |
| `location` | `string` | No       | —           |
| `body`     | `any`    | No       | —           |
| `query`    | `object` | No       | —           |
| `headers`  | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output**

| Name         | Type       | Required | Description |
| ------------ | ---------- | -------- | ----------- |
| `totalCount` | `number`   | No       | —           |
| `page`       | `number`   | No       | —           |
| `pageSize`   | `number`   | No       | —           |
| `leads`      | `object[]` | No       | —           |

<AccordionGroup>
  <Accordion title="leads full type">
    ```ts theme={null}
    {
      id?: string | number,
      firstname?: string,
      middlename?: string,
      lastname?: string,
      email?: string,
      phone?: string,
      status?: string | number,
      leadSourceId?: number,
      pipelineId?: number,
      stageId?: number
    }[]
    ```
  </Accordion>
</AccordionGroup>

***

### searchLeadsCount

`leads.searchLeadsCount`

Retrieves a summary of lead counts categorized by workflow stage from AgencyZoom; this action does not support filtering and returns aggregate counts rather than individual lead details. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not |

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.leads.searchLeadsCount({});
```

**Input**

| Name       | Type     | Required | Description |
| ---------- | -------- | -------- | ----------- |
| `page`     | `number` | No       | —           |
| `pageSize` | `number` | No       | —           |
| `sort`     | `string` | No       | —           |
| `order`    | `string` | No       | —           |
| `location` | `string` | No       | —           |
| `body`     | `any`    | No       | —           |
| `query`    | `object` | No       | —           |
| `headers`  | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### updateALeadFileName

`leads.updateALeadFileName`

Updates a lead's file name to `newFileName`; requires `fileId` of the target file, which must be associated with both the `leadId` (path parameter) and the provided `customerReferralId`.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.leads.updateALeadFileName({});
```

**Input**

| Name                 | Type     | Required | Description |
| -------------------- | -------- | -------- | ----------- |
| `fileId`             | `number` | Yes      | —           |
| `leadId`             | `number` | Yes      | —           |
| `newFileName`        | `string` | Yes      | —           |
| `customerReferralId` | `number` | No       | —           |
| `body`               | `any`    | No       | —           |
| `query`              | `object` | No       | —           |
| `headers`            | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### updateALeadOpportunity

`leads.updateALeadOpportunity`

Updates an existing opportunity's details (carrier, product line, premium, items, custom fields) for a specific lead; `leadId`, opportunity `id`, `carrierId`, and `productLineId` must refer to existing entities.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.leads.updateALeadOpportunity({});
```

**Input**

| Name            | Type     | Required | Description |
| --------------- | -------- | -------- | ----------- |
| `id`            | `number` | Yes      | —           |
| `items`         | `number` | No       | —           |
| `leadId`        | `number` | Yes      | —           |
| `premium`       | `number` | Yes      | —           |
| `carrierId`     | `number` | Yes      | —           |
| `customFields`  | `any[]`  | No       | —           |
| `productLineId` | `number` | Yes      | —           |
| `body`          | `any`    | No       | —           |
| `query`         | `object` | No       | —           |
| `headers`       | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### updateALeadQuote

`leads.updateALeadQuote`

Updates an existing quote for a specified lead in AgencyZoom when its details require revision, ensuring the provided `leadId` (path parameter), quote `id` (body parameter), `carrierId`, and `productLineId` are valid and correspond to existing entities.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.leads.updateALeadQuote({});
```

**Input**

| Name            | Type     | Required | Description |
| --------------- | -------- | -------- | ----------- |
| `id`            | `number` | Yes      | —           |
| `items`         | `number` | Yes      | —           |
| `leadId`        | `number` | Yes      | —           |
| `premium`       | `number` | Yes      | —           |
| `carrierId`     | `number` | Yes      | —           |
| `customFields`  | `any[]`  | No       | —           |
| `productLineId` | `number` | Yes      | —           |
| `body`          | `any`    | No       | —           |
| `query`         | `object` | No       | —           |
| `headers`       | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### updateBusinessLead

`leads.updateBusinessLead`

Updates an existing business lead in AgencyZoom. Requires leadId (path parameter) plus core business information fields: firstname, email, name (business name), pipelineId, stageId, leadSourceId, assignTo (producer ID), and country. All other fields are optional and will only update if provided.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.leads.updateBusinessLead({});
```

**Input**

| Name                          | Type     | Required | Description |
| ----------------------------- | -------- | -------- | ----------- |
| `dba`                         | `string` | No       | —           |
| `fax`                         | `string` | No       | —           |
| `zip`                         | `string` | No       | —           |
| `city`                        | `string` | No       | —           |
| `fein`                        | `string` | No       | —           |
| `name`                        | `string` | Yes      | —           |
| `csrId`                       | `number` | No       | —           |
| `email`                       | `string` | Yes      | —           |
| `notes`                       | `string` | No       | —           |
| `phone`                       | `string` | No       | —           |
| `state`                       | `string` | No       | —           |
| `xDate`                       | `string` | No       | —           |
| `leadId`                      | `number` | Yes      | —           |
| `country`                     | `string` | Yes      | —           |
| `payroll`                     | `string` | No       | —           |
| `stageId`                     | `number` | Yes      | —           |
| `assignTo`                    | `string` | Yes      | —           |
| `lastname`                    | `string` | No       | —           |
| `soldDate`                    | `string` | No       | —           |
| `tagNames`                    | `string` | No       | —           |
| `firstname`                   | `string` | Yes      | —           |
| `groupCode`                   | `string` | No       | —           |
| `otherCsrs`                   | `any[]`  | No       | —           |
| `quoteDate`                   | `string` | No       | —           |
| `middlename`                  | `string` | No       | —           |
| `pipelineId`                  | `number` | Yes      | —           |
| `contactDate`                 | `string` | No       | —           |
| `agencyNumber`                | `string` | No       | —           |
| `customFields`                | `any[]`  | No       | —           |
| `leadSourceId`                | `number` | Yes      | —           |
| `annualRevenue`               | `string` | No       | —           |
| `streetAddress`               | `string` | No       | —           |
| `departmentCode`              | `string` | No       | —           |
| `otherProducers`              | `any[]`  | No       | —           |
| `secondaryEmail`              | `string` | No       | —           |
| `secondaryPhone`              | `string` | No       | —           |
| `assignmentGroupId`           | `number` | No       | —           |
| `numberOfEmployees`           | `number` | No       | —           |
| `nextExpirationDate`          | `string` | No       | —           |
| `streetAddressLine2`          | `string` | No       | —           |
| `yearBusinessStarted`         | `string` | No       | —           |
| `businessClassification`      | `number` | No       | —           |
| `yearsOfManagementExperience` | `number` | No       | —           |
| `body`                        | `any`    | No       | —           |
| `query`                       | `object` | No       | —           |
| `headers`                     | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### updateLead

`leads.updateLead`

Updates an existing lead's information in AgencyZoom using the `leadId`; ensure the `leadId` corresponds to an existing lead in AgencyZoom.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.leads.updateLead({});
```

**Input**

| Name                 | Type      | Required | Description |
| -------------------- | --------- | -------- | ----------- |
| `zip`                | `string`  | No       | —           |
| `city`               | `string`  | No       | —           |
| `name`               | `string`  | No       | —           |
| `csrId`              | `number`  | No       | —           |
| `email`              | `string`  | Yes      | —           |
| `notes`              | `string`  | No       | —           |
| `phone`              | `string`  | No       | —           |
| `state`              | `string`  | No       | —           |
| `xDate`              | `string`  | No       | —           |
| `leadId`             | `number`  | Yes      | —           |
| `country`            | `string`  | Yes      | —           |
| `stageId`            | `number`  | Yes      | —           |
| `assignTo`           | `string`  | Yes      | —           |
| `birthday`           | `string`  | No       | —           |
| `lastname`           | `string`  | No       | —           |
| `nickname`           | `string`  | No       | —           |
| `soldDate`           | `string`  | No       | —           |
| `tagNames`           | `string`  | No       | —           |
| `firstname`          | `string`  | Yes      | —           |
| `groupCode`          | `string`  | No       | —           |
| `otherCsrs`          | `any[]`   | No       | —           |
| `quoteDate`          | `string`  | No       | —           |
| `isBusiness`         | `boolean` | No       | —           |
| `middlename`         | `string`  | No       | —           |
| `pipelineId`         | `number`  | Yes      | —           |
| `contactDate`        | `string`  | No       | —           |
| `agencyNumber`       | `string`  | No       | —           |
| `customFields`       | `any[]`   | No       | —           |
| `leadSourceId`       | `number`  | Yes      | —           |
| `maritalStatus`      | `number`  | No       | —           |
| `streetAddress`      | `string`  | No       | —           |
| `departmentCode`     | `string`  | No       | —           |
| `otherProducers`     | `any[]`   | No       | —           |
| `secondaryEmail`     | `string`  | No       | —           |
| `secondaryPhone`     | `string`  | No       | —           |
| `assignmentGroupId`  | `number`  | No       | —           |
| `nextExpirationDate` | `string`  | No       | —           |
| `streetAddressLine2` | `string`  | No       | —           |
| `body`               | `any`     | No       | —           |
| `query`              | `object`  | No       | —           |
| `headers`            | `object`  | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output**

| Name           | Type               | Required | Description |
| -------------- | ------------------ | -------- | ----------- |
| `id`           | `string \| number` | No       | —           |
| `firstname`    | `string`           | No       | —           |
| `middlename`   | `string`           | No       | —           |
| `lastname`     | `string`           | No       | —           |
| `email`        | `string`           | No       | —           |
| `phone`        | `string`           | No       | —           |
| `status`       | `string \| number` | No       | —           |
| `leadSourceId` | `number`           | No       | —           |
| `pipelineId`   | `number`           | No       | —           |
| `stageId`      | `number`           | No       | —           |

***

### updateLeadStatusById

`leads.updateLeadStatusById`

Updates a lead's status (0=ACTIVE, 2=WON, 3=LOST, 5=XDATED) by `leadId`, optionally setting workflow, stage, date, loss reason, X-date type, source, recycle stage/pipeline, or tags; requires `date` and `xDateType` for status 5 (XDATED), and `lossReasonId` for status 3 (LOST).

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.leads.updateLeadStatusById({});
```

**Input**

| Name                 | Type     | Required | Description |
| -------------------- | -------- | -------- | ----------- |
| `date`               | `string` | No       | —           |
| `leadId`             | `number` | Yes      | —           |
| `status`             | `number` | Yes      | —           |
| `tagIds`             | `any[]`  | No       | —           |
| `toStageId`          | `number` | No       | —           |
| `xDateType`          | `string` | No       | —           |
| `workflowId`         | `number` | No       | —           |
| `lossReasonId`       | `number` | No       | —           |
| `recycleToStage`     | `number` | No       | —           |
| `workflowStageId`    | `number` | No       | —           |
| `recycleToPipeline`  | `number` | No       | —           |
| `changeLeadSourceTo` | `number` | No       | —           |
| `body`               | `any`    | No       | —           |
| `query`              | `object` | No       | —           |
| `headers`            | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

## Life

### searchLifeAndHealthLeads

`life.searchLifeAndHealthLeads`

Searches for life and health insurance leads by providing filter criteria (matching AlrLead fields) in the request body; an empty request may retrieve all leads or a default set. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not |

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.life.searchLifeAndHealthLeads({});
```

**Input**

| Name       | Type     | Required | Description |
| ---------- | -------- | -------- | ----------- |
| `page`     | `number` | No       | —           |
| `pageSize` | `number` | No       | —           |
| `sort`     | `string` | No       | —           |
| `order`    | `string` | No       | —           |
| `location` | `string` | No       | —           |
| `body`     | `any`    | No       | —           |
| `query`    | `object` | No       | —           |
| `headers`  | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

## Opportunities

### createADriverForAnOpportunity

`opportunities.createADriverForAnOpportunity`

Creates a new driver record associated with an existing AgencyZoom opportunity using its ID; requires firstName and lastName, with optional fields for additional driver details.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.opportunities.createADriverForAnOpportunity({});
```

**Input**

| Name            | Type     | Required | Description |
| --------------- | -------- | -------- | ----------- |
| `gender`        | `string` | No       | —           |
| `birthday`      | `string` | No       | —           |
| `lastName`      | `string` | Yes      | —           |
| `firstName`     | `string` | Yes      | —           |
| `middleName`    | `string` | No       | —           |
| `relationship`  | `string` | No       | —           |
| `licenseNumber` | `string` | No       | —           |
| `maritalStatus` | `number` | No       | —           |
| `opportunityId` | `number` | Yes      | —           |
| `stateLicensed` | `string` | No       | —           |
| `body`          | `any`    | No       | —           |
| `query`         | `object` | No       | —           |
| `headers`       | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### createAnOpportunity

`opportunities.createAnOpportunity`

Creates a new lead opportunity in AgencyZoom; this action cannot update existing opportunities.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.opportunities.createAnOpportunity({});
```

**Input**

| Name                                    | Type     | Required | Description |
| --------------------------------------- | -------- | -------- | ----------- |
| `items`                                 | `number` | No       | —           |
| `premium`                               | `number` | No       | —           |
| `carrierId`                             | `number` | No       | —           |
| `expiryDate`                            | `string` | No       | —           |
| `customFields`                          | `any[]`  | No       | —           |
| `productLineId`                         | `number` | Yes      | —           |
| `property__zip`                         | `string` | No       | —           |
| `property__city`                        | `string` | No       | —           |
| `property__state`                       | `string` | No       | —           |
| `property__country`                     | `string` | No       | —           |
| `customerReferralId`                    | `number` | Yes      | —           |
| `property__address1`                    | `string` | No       | —           |
| `property__address2`                    | `string` | No       | —           |
| `property__useMailingAddressAsLocation` | `number` | No       | —           |
| `body`                                  | `any`    | No       | —           |
| `query`                                 | `object` | No       | —           |
| `headers`                               | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output**

| Name            | Type               | Required | Description |
| --------------- | ------------------ | -------- | ----------- |
| `id`            | `string \| number` | No       | —           |
| `carrierId`     | `number`           | No       | —           |
| `productLineId` | `number`           | No       | —           |
| `premium`       | `number`           | No       | —           |
| `items`         | `number`           | No       | —           |
| `status`        | `number`           | No       | —           |

***

### createAVehicleForAnOpportunity

`opportunities.createAVehicleForAnOpportunity`

Adds a new vehicle record to a specified opportunity; `opportunityId` must refer to a valid, existing opportunity.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.opportunities.createAVehicleForAnOpportunity({});
```

**Input**

| Name            | Type     | Required | Description |
| --------------- | -------- | -------- | ----------- |
| `vin`           | `string` | No       | —           |
| `make`          | `string` | Yes      | —           |
| `year`          | `number` | No       | —           |
| `model`         | `string` | No       | —           |
| `ownership`     | `string` | No       | —           |
| `opportunityId` | `number` | Yes      | —           |
| `body`          | `any`    | No       | —           |
| `query`         | `object` | No       | —           |
| `headers`       | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### deleteADriver

`opportunities.deleteADriver`

Permanently deletes an existing driver record (a person associated with an insurance opportunity) from AgencyZoom using its unique `driverId`; this action is irreversible.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.agencyzoom.api.opportunities.deleteADriver({});
```

**Input**

| Name       | Type     | Required | Description |
| ---------- | -------- | -------- | ----------- |
| `driverId` | `number` | Yes      | —           |
| `body`     | `any`    | No       | —           |
| `query`    | `object` | No       | —           |
| `headers`  | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### deleteAnOpportunity

`opportunities.deleteAnOpportunity`

Permanently deletes a specific opportunity by its unique ID; this action is irreversible and requires a valid, existing `opportunityId`.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.agencyzoom.api.opportunities.deleteAnOpportunity({});
```

**Input**

| Name            | Type     | Required | Description |
| --------------- | -------- | -------- | ----------- |
| `opportunityId` | `number` | Yes      | —           |
| `body`          | `any`    | No       | —           |
| `query`         | `object` | No       | —           |
| `headers`       | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### deleteAVehicle

`opportunities.deleteAVehicle`

Permanently deletes a vehicle record by its `vehicleId`, which must correspond to an existing vehicle in the AgencyZoom system.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.agencyzoom.api.opportunities.deleteAVehicle({});
```

**Input**

| Name        | Type     | Required | Description |
| ----------- | -------- | -------- | ----------- |
| `vehicleId` | `number` | Yes      | —           |
| `body`      | `any`    | No       | —           |
| `query`     | `object` | No       | —           |
| `headers`   | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### getAListOfDriversForAnOpportunity

`opportunities.getAListOfDriversForAnOpportunity`

Retrieves a list of drivers (individuals), including their personal details, licensing information, and relationship status, associated with a specific, existing `opportunityId` in AgencyZoom.

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.opportunities.getAListOfDriversForAnOpportunity({});
```

**Input**

| Name            | Type     | Required | Description |
| --------------- | -------- | -------- | ----------- |
| `opportunityId` | `number` | Yes      | —           |
| `body`          | `any`    | No       | —           |
| `query`         | `object` | No       | —           |
| `headers`       | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### getAListOfVehiclesForAnOpportunity

`opportunities.getAListOfVehiclesForAnOpportunity`

Retrieves all vehicles associated with an existing opportunity, using its unique opportunityId.

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.opportunities.getAListOfVehiclesForAnOpportunity({});
```

**Input**

| Name            | Type     | Required | Description |
| --------------- | -------- | -------- | ----------- |
| `opportunityId` | `number` | Yes      | —           |
| `body`          | `any`    | No       | —           |
| `query`         | `object` | No       | —           |
| `headers`       | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### getTheDriverDetails

`opportunities.getTheDriverDetails`

Retrieves detailed information for a specific, existing driver (by `driverId`) associated with an AgencyZoom opportunity.

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.opportunities.getTheDriverDetails({});
```

**Input**

| Name       | Type     | Required | Description |
| ---------- | -------- | -------- | ----------- |
| `driverId` | `number` | Yes      | —           |
| `body`     | `any`    | No       | —           |
| `query`    | `object` | No       | —           |
| `headers`  | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### getTheOpportunityDetails

`opportunities.getTheOpportunityDetails`

Fetches comprehensive details for an existing opportunity using its unique `opportunityId`.

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.opportunities.getTheOpportunityDetails({});
```

**Input**

| Name            | Type     | Required | Description |
| --------------- | -------- | -------- | ----------- |
| `opportunityId` | `number` | Yes      | —           |
| `body`          | `any`    | No       | —           |
| `query`         | `object` | No       | —           |
| `headers`       | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output**

| Name            | Type               | Required | Description |
| --------------- | ------------------ | -------- | ----------- |
| `id`            | `string \| number` | No       | —           |
| `carrierId`     | `number`           | No       | —           |
| `productLineId` | `number`           | No       | —           |
| `premium`       | `number`           | No       | —           |
| `items`         | `number`           | No       | —           |
| `status`        | `number`           | No       | —           |

***

### getTheVehicleDetails

`opportunities.getTheVehicleDetails`

Retrieves detailed information for a specific vehicle, often associated with an AgencyZoom opportunity, using its unique vehicleId.

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.opportunities.getTheVehicleDetails({});
```

**Input**

| Name        | Type     | Required | Description |
| ----------- | -------- | -------- | ----------- |
| `vehicleId` | `number` | Yes      | —           |
| `body`      | `any`    | No       | —           |
| `query`     | `object` | No       | —           |
| `headers`   | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### linkADriverToOpportunity

`opportunities.linkADriverToOpportunity`

Assigns or reassigns an existing driver to an existing opportunity.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.opportunities.linkADriverToOpportunity({});
```

**Input**

| Name            | Type     | Required | Description |
| --------------- | -------- | -------- | ----------- |
| `driverId`      | `number` | Yes      | —           |
| `opportunityId` | `number` | Yes      | —           |
| `body`          | `any`    | No       | —           |
| `query`         | `object` | No       | —           |
| `headers`       | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### linkAVehicleToOpportunity

`opportunities.linkAVehicleToOpportunity`

Links an existing vehicle to an existing sales opportunity in AgencyZoom using their respective IDs, typically for managing auto insurance policies or related services.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.opportunities.linkAVehicleToOpportunity({});
```

**Input**

| Name            | Type     | Required | Description |
| --------------- | -------- | -------- | ----------- |
| `vehicleId`     | `number` | Yes      | —           |
| `opportunityId` | `number` | Yes      | —           |
| `body`          | `any`    | No       | —           |
| `query`         | `object` | No       | —           |
| `headers`       | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### unlinkADriverFromOpportunity

`opportunities.unlinkADriverFromOpportunity`

Unlinks a currently associated driver from an AgencyZoom opportunity, used when the driver is no longer relevant, for policy or data updates, potentially impacting the opportunity's status or associated policy details.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.opportunities.unlinkADriverFromOpportunity({});
```

**Input**

| Name            | Type     | Required | Description |
| --------------- | -------- | -------- | ----------- |
| `driverId`      | `number` | Yes      | —           |
| `opportunityId` | `number` | Yes      | —           |
| `body`          | `any`    | No       | —           |
| `query`         | `object` | No       | —           |
| `headers`       | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### unlinkAVehicleFromOpportunity

`opportunities.unlinkAVehicleFromOpportunity`

Unlinks a specific, existing vehicle from a specific, existing opportunity using their respective IDs, removing only the association and not the records themselves.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.opportunities.unlinkAVehicleFromOpportunity({});
```

**Input**

| Name            | Type     | Required | Description |
| --------------- | -------- | -------- | ----------- |
| `vehicleId`     | `number` | Yes      | —           |
| `opportunityId` | `number` | Yes      | —           |
| `body`          | `any`    | No       | —           |
| `query`         | `object` | No       | —           |
| `headers`       | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### updateADriverSDetails

`opportunities.updateADriverSDetails`

Updates an existing driver's details in AgencyZoom, requiring `driverId` in the path and `firstName` and `lastName` in the request.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.opportunities.updateADriverSDetails({});
```

**Input**

| Name            | Type     | Required | Description |
| --------------- | -------- | -------- | ----------- |
| `gender`        | `string` | No       | —           |
| `birthday`      | `string` | No       | —           |
| `driverId`      | `number` | Yes      | —           |
| `lastName`      | `string` | Yes      | —           |
| `firstName`     | `string` | Yes      | —           |
| `middleName`    | `string` | No       | —           |
| `relationship`  | `string` | No       | —           |
| `licenseNumber` | `string` | No       | —           |
| `maritalStatus` | `number` | No       | —           |
| `stateLicensed` | `string` | No       | —           |
| `body`          | `any`    | No       | —           |
| `query`         | `object` | No       | —           |
| `headers`       | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### updateAnOpportunity

`opportunities.updateAnOpportunity`

Updates an existing opportunity with the provided details; ensure any custom field names are predefined in AgencyZoom configuration.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.opportunities.updateAnOpportunity({});
```

**Input**

| Name                                    | Type     | Required | Description |
| --------------------------------------- | -------- | -------- | ----------- |
| `items`                                 | `number` | No       | —           |
| `premium`                               | `number` | No       | —           |
| `carrierId`                             | `number` | No       | —           |
| `expiryDate`                            | `string` | No       | —           |
| `customFields`                          | `any[]`  | No       | —           |
| `opportunityId`                         | `number` | Yes      | —           |
| `productLineId`                         | `number` | No       | —           |
| `property__zip`                         | `string` | No       | —           |
| `property__city`                        | `string` | No       | —           |
| `property__state`                       | `string` | No       | —           |
| `property__country`                     | `string` | No       | —           |
| `property__address1`                    | `string` | No       | —           |
| `property__address2`                    | `string` | No       | —           |
| `property__useMailingAddressAsLocation` | `number` | No       | —           |
| `body`                                  | `any`    | No       | —           |
| `query`                                 | `object` | No       | —           |
| `headers`                               | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output**

| Name            | Type               | Required | Description |
| --------------- | ------------------ | -------- | ----------- |
| `id`            | `string \| number` | No       | —           |
| `carrierId`     | `number`           | No       | —           |
| `productLineId` | `number`           | No       | —           |
| `premium`       | `number`           | No       | —           |
| `items`         | `number`           | No       | —           |
| `status`        | `number`           | No       | —           |

***

### updateAVehicleSDetails

`opportunities.updateAVehicleSDetails`

Updates details for an existing vehicle within an opportunity; this action cannot be used to create new vehicle records.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.opportunities.updateAVehicleSDetails({});
```

**Input**

| Name        | Type     | Required | Description |
| ----------- | -------- | -------- | ----------- |
| `vin`       | `string` | No       | —           |
| `make`      | `string` | No       | —           |
| `year`      | `number` | No       | —           |
| `model`     | `string` | No       | —           |
| `ownership` | `string` | No       | —           |
| `vehicleId` | `number` | Yes      | —           |
| `body`      | `any`    | No       | —           |
| `query`     | `object` | No       | —           |
| `headers`   | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

## Policies

### updateAPolicy

`policies.updateAPolicy`

Updates an existing insurance policy for the given `policyId`; monetary values must be in cents and dates in YYYY-MM-DD format.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.policies.updateAPolicy({});
```

**Input**

| Name                | Type     | Required | Description |
| ------------------- | -------- | -------- | ----------- |
| `items`             | `number` | No       | —           |
| `agentId`           | `number` | No       | —           |
| `premium`           | `number` | No       | —           |
| `policyId`          | `number` | Yes      | —           |
| `soldDate`          | `string` | No       | —           |
| `brokerFee`         | `number` | No       | —           |
| `carrierId`         | `number` | No       | —           |
| `groupCode`         | `string` | No       | —           |
| `expiryDate`        | `string` | No       | —           |
| `policyType`        | `number` | No       | —           |
| `insuredName`       | `string` | No       | —           |
| `agencyNumber`      | `string` | No       | —           |
| `leadSourceId`      | `number` | No       | —           |
| `policyNumber`      | `string` | No       | —           |
| `effectiveDate`     | `string` | No       | —           |
| `departmentCode`    | `string` | No       | —           |
| `priorExpiryDate`   | `string` | No       | —           |
| `priorCarrierName`  | `string` | No       | —           |
| `priorPolicyNumber` | `string` | No       | —           |
| `productCategoryId` | `number` | No       | —           |
| `body`              | `any`    | No       | —           |
| `query`             | `object` | No       | —           |
| `headers`           | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### updateTagsForAPolicy

`policies.updateTagsForAPolicy`

Adds new comma-separated `tagNames` to a policy, requiring `tagNames` and identification by either `policyId` or `amsPolicyId`; if `amsPolicyId` is provided, `policyId` is ignored, and existing tags are not affected.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.policies.updateTagsForAPolicy({});
```

**Input**

| Name          | Type     | Required | Description |
| ------------- | -------- | -------- | ----------- |
| `policyId`    | `number` | No       | —           |
| `tagNames`    | `string` | Yes      | —           |
| `amsPolicyId` | `number` | No       | —           |
| `body`        | `any`    | No       | —           |
| `query`       | `object` | No       | —           |
| `headers`     | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

## Profile

### updateMyProfile

`profile.updateMyProfile`

Updates the profile information (first name, last name, email, and optional phone) for the currently authenticated user in AgencyZoom; the provided email address must be unique within the system.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.profile.updateMyProfile({});
```

**Input**

| Name        | Type     | Required | Description |
| ----------- | -------- | -------- | ----------- |
| `email`     | `string` | Yes      | —           |
| `phone`     | `string` | No       | —           |
| `lastname`  | `string` | Yes      | —           |
| `firstname` | `string` | Yes      | —           |
| `body`      | `any`    | No       | —           |
| `query`     | `object` | No       | —           |
| `headers`   | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

## Reference Data

### getAListOfAssignGroups

`referenceData.getAListOfAssignGroups`

Retrieves all assign groups configured in AgencyZoom, used for categorizing or assigning items to specific teams or units. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not |

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.referenceData.getAListOfAssignGroups({});
```

**Input**

| Name      | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `body`    | `any`    | No       | —           |
| `query`   | `object` | No       | —           |
| `headers` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### getAListOfCarriers

`referenceData.getAListOfCarriers`

Retrieves all insurance carriers from AgencyZoom, typically used for populating selection lists or synchronizing carrier data; does not return detailed policy or coverage information. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not |

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.referenceData.getAListOfCarriers({});
```

**Input**

| Name      | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `body`    | `any`    | No       | —           |
| `query`   | `object` | No       | —           |
| `headers` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### getAListOfCsrs

`referenceData.getAListOfCsrs`

Fetches all Customer Service Representatives (CSRs), including their ID and name, returning an empty list if none are configured. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not |

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.referenceData.getAListOfCsrs({});
```

**Input**

| Name      | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `body`    | `any`    | No       | —           |
| `query`   | `object` | No       | —           |
| `headers` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### getAListOfCustomFields

`referenceData.getAListOfCustomFields`

Retrieves metadata for all configured custom field definitions, not the specific values entered for individual records. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not |

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.referenceData.getAListOfCustomFields({});
```

**Input**

| Name      | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `body`    | `any`    | No       | —           |
| `query`   | `object` | No       | —           |
| `headers` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### getAListOfEmployees

`referenceData.getAListOfEmployees`

Retrieves a complete list of all employees for the authenticated agency; returns an empty list if no employees are configured. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not |

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.referenceData.getAListOfEmployees({});
```

**Input**

| Name      | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `body`    | `any`    | No       | —           |
| `query`   | `object` | No       | —           |
| `headers` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### getAListOfLeadSourceCategories

`referenceData.getAListOfLeadSourceCategories`

Retrieves a comprehensive list of all predefined lead source categories from AgencyZoom, used to classify lead origins. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not |

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.referenceData.getAListOfLeadSourceCategories({});
```

**Input**

| Name      | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `body`    | `any`    | No       | —           |
| `query`   | `object` | No       | —           |
| `headers` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### getAListOfLeadSources

`referenceData.getAListOfLeadSources`

Fetches a list of all lead sources configured in AgencyZoom, including their ID, name, sales exclusion status, and category ID. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not |

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.referenceData.getAListOfLeadSources({});
```

**Input**

| Name      | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `body`    | `any`    | No       | —           |
| `query`   | `object` | No       | —           |
| `headers` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### getAListOfLifeProfessionals

`referenceData.getAListOfLifeProfessionals`

Retrieves a list of life insurance professionals, including only their contact and status information (excluding sales or customer data), from the AgencyZoom platform. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not |

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.referenceData.getAListOfLifeProfessionals({});
```

**Input**

| Name      | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `body`    | `any`    | No       | —           |
| `query`   | `object` | No       | —           |
| `headers` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### getAListOfLocations

`referenceData.getAListOfLocations`

Retrieves all agency locations or branches from AgencyZoom; filtering options are not available. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not |

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.referenceData.getAListOfLocations({});
```

**Input**

| Name      | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `body`    | `any`    | No       | —           |
| `query`   | `object` | No       | —           |
| `headers` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### getAListOfLossReasons

`referenceData.getAListOfLossReasons`

Retrieves all predefined loss reasons (e.g., 'Lost to competitor', 'Premium too high') available in AgencyZoom. These reasons can be used when marking leads as lost or for reporting purposes. No parameters required - returns complete list. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not |

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.referenceData.getAListOfLossReasons({});
```

**Input**

| Name      | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `body`    | `any`    | No       | —           |
| `query`   | `object` | No       | —           |
| `headers` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### getAListOfPipelines

`referenceData.getAListOfPipelines`

Retrieves all pipelines and their stages from AgencyZoom to understand workflow structures; this is a read-only operation and does not return individual items (like leads or tasks) within these pipelines. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not |

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.referenceData.getAListOfPipelines({});
```

**Input**

| Name      | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `body`    | `any`    | No       | —           |
| `query`   | `object` | No       | —           |
| `headers` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### getAListOfProductLinesPolicyTypes

`referenceData.getAListOfProductLinesPolicyTypes`

Fetches all product lines and policy types from AgencyZoom, each detailed with its ID, name, and product category ID. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not |

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.referenceData.getAListOfProductLinesPolicyTypes({});
```

**Input**

| Name      | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `body`    | `any`    | No       | —           |
| `query`   | `object` | No       | —           |
| `headers` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### getAListOfRecycleEvents

`referenceData.getAListOfRecycleEvents`

Retrieves the available recycle event types and any existing X-Date information for a specified lead in AgencyZoom. Returns a list of recycle event categories that can be used to trigger follow-ups (e.g., 'X-Date', 'Accident Falls Off', 'Prior Insurance Fulfilled').

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.referenceData.getAListOfRecycleEvents({});
```

**Input**

| Name      | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `leadId`  | `number` | Yes      | —           |
| `body`    | `any`    | No       | —           |
| `query`   | `object` | No       | —           |
| `headers` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output**

| Name            | Type    | Required | Description |
| --------------- | ------- | -------- | ----------- |
| `existingXDate` | `any[]` | No       | —           |
| `newXDate`      | `any[]` | No       | —           |

***

### getDepartmentsGroups

`referenceData.getDepartmentsGroups`

Fetches department and group information for an agency, optionally filtered by a specific `agencyNumber`, to analyze its organizational structure.

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.referenceData.getDepartmentsGroups({});
```

**Input**

| Name           | Type     | Required | Description |
| -------------- | -------- | -------- | ----------- |
| `agencyNumber` | `string` | No       | —           |
| `body`         | `any`    | No       | —           |
| `query`        | `object` | No       | —           |
| `headers`      | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### getListOfEndStages

`referenceData.getListOfEndStages`

Fetches a list of all defined end stages, representing final steps in processes like lead conversion or policy closure. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not |

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.referenceData.getListOfEndStages({});
```

**Input**

| Name      | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `body`    | `any`    | No       | —           |
| `query`   | `object` | No       | —           |
| `headers` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### listProductCategories

`referenceData.listProductCategories`

Retrieves a complete, unfiltered list of all product categories (ID and name) from AgencyZoom, useful for understanding product organization or populating UI elements. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not |

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.referenceData.listProductCategories({});
```

**Input**

| Name      | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `body`    | `any`    | No       | —           |
| `query`   | `object` | No       | —           |
| `headers` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### searchBusinessClassifications

`referenceData.searchBusinessClassifications`

Retrieves a comprehensive list of all available business classifications from AgencyZoom, each including an ID, code, and description. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not |

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.referenceData.searchBusinessClassifications({});
```

**Input**

| Name       | Type     | Required | Description |
| ---------- | -------- | -------- | ----------- |
| `page`     | `number` | No       | —           |
| `pageSize` | `number` | No       | —           |
| `sort`     | `string` | No       | —           |
| `order`    | `string` | No       | —           |
| `location` | `string` | No       | —           |
| `body`     | `any`    | No       | —           |
| `query`    | `object` | No       | —           |
| `headers`  | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

## Service Tickets

### serviceTicketList

`serviceTickets.serviceTicketList`

Retrieves a paginated list of service tickets from AgencyZoom. Supports filtering by: - Status (0=removed, 1=active, 2=completed) - Priority ID and Category ID Returns service ticket details including subject, description, dates, assignment information, and workflow stage. Results are paginated with default page size of 20 tickets per page.

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.serviceTickets.serviceTicketList({});
```

**Input**

| Name         | Type     | Required | Description |
| ------------ | -------- | -------- | ----------- |
| `page`       | `number` | No       | —           |
| `status`     | `number` | No       | —           |
| `pageSize`   | `number` | No       | —           |
| `categoryId` | `number` | No       | —           |
| `priorityId` | `number` | No       | —           |
| `body`       | `any`    | No       | —           |
| `query`      | `object` | No       | —           |
| `headers`    | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

## Tasks

### batchDeleteTask

`tasks.batchDeleteTask`

Deletes multiple AgencyZoom tasks in a batch; task deletion is permanent and the response indicates overall batch success, not individual task status.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.agencyzoom.api.tasks.batchDeleteTask({});
```

**Input**

| Name      | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `taskIds` | `any[]`  | Yes      | —           |
| `body`    | `any`    | No       | —           |
| `query`   | `object` | No       | —           |
| `headers` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### completeTask

`tasks.completeTask`

Marks an existing and accessible task in AgencyZoom as 'completed'; this action does not return the full updated task object.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.tasks.completeTask({});
```

**Input**

| Name      | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `taskId`  | `number` | Yes      | —           |
| `body`    | `any`    | No       | —           |
| `query`   | `object` | No       | —           |
| `headers` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### createTask

`tasks.createTask`

Creates a new task in AgencyZoom; ensure `assigneeId`, `customerId`, or `leadId` are valid existing entities if provided, and use `contactEmail`, `customerId`, or `leadId` to link the task to a contact.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.tasks.createTask({});
```

**Input**

| Name                 | Type      | Required | Description |
| -------------------- | --------- | -------- | ----------- |
| `type`               | `string`  | No       | —           |
| `title`              | `string`  | No       | —           |
| `leadId`             | `number`  | No       | —           |
| `comments`           | `string`  | No       | —           |
| `duration`           | `number`  | No       | —           |
| `invitees`           | `any[]`   | No       | —           |
| `assigneeId`         | `number`  | No       | —           |
| `customerId`         | `number`  | No       | —           |
| `dueDatetime`        | `string`  | No       | —           |
| `contactEmail`       | `string`  | No       | —           |
| `timeSpecific`       | `boolean` | No       | —           |
| `lifeProfessionalId` | `number`  | No       | —           |
| `body`               | `any`     | No       | —           |
| `query`              | `object`  | No       | —           |
| `headers`            | `object`  | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output**

| Name         | Type               | Required | Description |
| ------------ | ------------------ | -------- | ----------- |
| `id`         | `string \| number` | No       | —           |
| `title`      | `string`           | No       | —           |
| `status`     | `string \| number` | No       | —           |
| `dueDate`    | `string`           | No       | —           |
| `comments`   | `string`           | No       | —           |
| `customerId` | `number`           | No       | —           |
| `leadId`     | `number`           | No       | —           |

***

### deleteATask

`tasks.deleteATask`

Permanently and irreversibly deletes an existing task, identified by its `taskId`.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.agencyzoom.api.tasks.deleteATask({});
```

**Input**

| Name      | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `taskId`  | `number` | Yes      | —           |
| `body`    | `any`    | No       | —           |
| `query`   | `object` | No       | —           |
| `headers` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### getTheTaskDetails

`tasks.getTheTaskDetails`

Retrieves comprehensive details for a specific task using its unique `taskId`, which must correspond to an existing task in AgencyZoom.

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.tasks.getTheTaskDetails({});
```

**Input**

| Name      | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `taskId`  | `number` | Yes      | —           |
| `body`    | `any`    | No       | —           |
| `query`   | `object` | No       | —           |
| `headers` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output**

| Name         | Type               | Required | Description |
| ------------ | ------------------ | -------- | ----------- |
| `id`         | `string \| number` | No       | —           |
| `title`      | `string`           | No       | —           |
| `status`     | `string \| number` | No       | —           |
| `dueDate`    | `string`           | No       | —           |
| `comments`   | `string`           | No       | —           |
| `customerId` | `number`           | No       | —           |
| `leadId`     | `number`           | No       | —           |

***

### reopenATask

`tasks.reopenATask`

Reopens an existing AgencyZoom task that is currently 'completed' or 'closed', allowing it to be reactivated with optional comments.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.tasks.reopenATask({});
```

**Input**

| Name       | Type     | Required | Description |
| ---------- | -------- | -------- | ----------- |
| `taskId`   | `number` | Yes      | —           |
| `comments` | `string` | No       | —           |
| `body`     | `any`    | No       | —           |
| `query`    | `object` | No       | —           |
| `headers`  | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### searchTasks

`tasks.searchTasks`

Searches and lists tasks, supporting pagination and accepting filter criteria in the POST request body despite an empty request schema.

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.tasks.searchTasks({});
```

**Input**

| Name                   | Type     | Required | Description |
| ---------------------- | -------- | -------- | ----------- |
| `page`                 | `number` | No       | —           |
| `sort`                 | `string` | No       | —           |
| `type`                 | `string` | No       | —           |
| `order`                | `string` | No       | —           |
| `period`               | `string` | No       | —           |
| `status`               | `number` | No       | —           |
| `endDate`              | `string` | No       | —           |
| `location`             | `string` | No       | —           |
| `pageSize`             | `number` | No       | —           |
| `startDate`            | `string` | No       | —           |
| `assigneeId`           | `number` | No       | —           |
| `leadSourceId`         | `number` | No       | —           |
| `lifeProfessionalId`   | `number` | No       | —           |
| `leadSourceCategoryId` | `number` | No       | —           |
| `body`                 | `any`    | No       | —           |
| `query`                | `object` | No       | —           |
| `headers`              | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### updateTask

`tasks.updateTask`

Modifies an existing AgencyZoom task (which must be valid and identified by `taskId` in the path) with new attributes from the request body, which must also contain `taskId`.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.tasks.updateTask({});
```

**Input**

| Name                 | Type      | Required | Description |
| -------------------- | --------- | -------- | ----------- |
| `type`               | `string`  | No       | —           |
| `title`              | `string`  | No       | —           |
| `leadId`             | `number`  | No       | —           |
| `taskId`             | `number`  | Yes      | —           |
| `comments`           | `string`  | No       | —           |
| `duration`           | `number`  | No       | —           |
| `invitees`           | `any[]`   | No       | —           |
| `assigneeId`         | `number`  | No       | —           |
| `customerId`         | `number`  | No       | —           |
| `dueDatetime`        | `string`  | No       | —           |
| `contactEmail`       | `string`  | No       | —           |
| `timeSpecific`       | `boolean` | No       | —           |
| `lifeProfessionalId` | `number`  | No       | —           |
| `body`               | `any`     | No       | —           |
| `query`              | `object`  | No       | —           |
| `headers`            | `object`  | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output**

| Name         | Type               | Required | Description |
| ------------ | ------------------ | -------- | ----------- |
| `id`         | `string \| number` | No       | —           |
| `title`      | `string`           | No       | —           |
| `status`     | `string \| number` | No       | —           |
| `dueDate`    | `string`           | No       | —           |
| `comments`   | `string`           | No       | —           |
| `customerId` | `number`           | No       | —           |
| `leadId`     | `number`           | No       | —           |

***

## Text Threads

### getAListOfProducer

`textThreads.getAListOfProducer`

Retrieves a list of all producers from AgencyZoom, typically related to text thread functionalities. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not |

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.textThreads.getAListOfProducer({});
```

**Input**

| Name      | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `body`    | `any`    | No       | —           |
| `query`   | `object` | No       | —           |
| `headers` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### removeTextThreadEndpoint

`textThreads.removeTextThreadEndpoint`

Call this action to permanently delete an SMS/text message thread in AgencyZoom; the target thread is identified by its `threadId`. Note: This operation is idempotent - deleting a non-existent thread will return success.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.agencyzoom.api.textThreads.removeTextThreadEndpoint({});
```

**Input**

| Name       | Type     | Required | Description |
| ---------- | -------- | -------- | ----------- |
| `threadId` | `string` | Yes      | —           |
| `page`     | `number` | No       | —           |
| `pageSize` | `number` | No       | —           |
| `sort`     | `string` | No       | —           |
| `order`    | `string` | No       | —           |
| `location` | `string` | No       | —           |
| `body`     | `any`    | No       | —           |
| `query`    | `object` | No       | —           |
| `headers`  | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### searchSmsThreads

`textThreads.searchSmsThreads`

Searches and retrieves SMS threads from AgencyZoom, with search parameters, filters, sorting, and pagination typically provided in the request body of this POST operation. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not |

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.textThreads.searchSmsThreads({});
```

**Input**

| Name       | Type     | Required | Description |
| ---------- | -------- | -------- | ----------- |
| `page`     | `number` | No       | —           |
| `pageSize` | `number` | No       | —           |
| `sort`     | `string` | No       | —           |
| `order`    | `string` | No       | —           |
| `location` | `string` | No       | —           |
| `body`     | `any`    | No       | —           |
| `query`    | `object` | No       | —           |
| `headers`  | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### textDetailThread

`textThreads.textDetailThread`

Retrieves detailed messages for a specific SMS/text thread by its thread ID. Returns all messages in the thread with their content, attachments, sender/recipient information, and metadata. The thread ID can be obtained from the search\_sms\_threads action.

**Risk:** `read`

```ts theme={null}
await corsair.agencyzoom.api.textThreads.textDetailThread({});
```

**Input**

| Name          | Type     | Required | Description |
| ------------- | -------- | -------- | ----------- |
| `threadId`    | `string` | Yes      | —           |
| `page`        | `number` | No       | —           |
| `pageSize`    | `number` | No       | —           |
| `sort`        | `string` | No       | —           |
| `order`       | `string` | No       | —           |
| `location`    | `string` | No       | —           |
| `searchTerm`  | `string` | No       | —           |
| `status`      | `number` | No       | —           |
| `lastDateUTC` | `string` | No       | —           |
| `body`        | `any`    | No       | —           |
| `query`       | `object` | No       | —           |
| `headers`     | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

### unreadThread

`textThreads.unreadThread`

Updates the read or unread status of a specific SMS/text thread within AgencyZoom.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.textThreads.unreadThread({});
```

**Input**

| Name         | Type      | Required | Description |
| ------------ | --------- | -------- | ----------- |
| `threadId`   | `string`  | Yes      | —           |
| `markUnread` | `boolean` | Yes      | —           |
| `body`       | `any`     | No       | —           |
| `query`      | `object`  | No       | —           |
| `headers`    | `object`  | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***

## V4sso

### authenticateForJwtviaV4Sso

`v4sso.authenticateForJwtviaV4Sso`

Completes AgencyZoom V4 Single Sign-On (SSO) authentication by exchanging an OAuth2 authorization code for a JWT token. Prerequisites: First call get\_auth\_url\_for\_v4sso to obtain the authentication URL, then redirect the user to that URL for login. After successful authentication through Vertafore's OAuth provider, the callback will include a 'code' parameter. Use that code with this action to obtain the JWT token for API access. Note: This is typically used during initial authentication setup. The code is single-use, time-limited, and must match the PKCE challenge from the original auth request.

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.v4sso.authenticateForJwtviaV4Sso({});
```

**Input**

| Name      | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `code`    | `string` | Yes      | —           |
| `body`    | `any`    | No       | —           |
| `query`   | `object` | No       | —           |
| `headers` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output**

| Name         | Type      | Required | Description |
| ------------ | --------- | -------- | ----------- |
| `jwt`        | `string`  | Yes      | —           |
| `ownerAgent` | `boolean` | No       | —           |

***

### getAuthUrlForV4Sso

`v4sso.getAuthUrlForV4Sso`

Retrieves a fresh authentication URL for AgencyZoom's V4 Single Sign-On (SSO) process; call before each SSO attempt as the URL may change and should not be cached. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not |

**Risk:** `write`

```ts theme={null}
await corsair.agencyzoom.api.v4sso.getAuthUrlForV4Sso({});
```

**Input**

| Name      | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `body`    | `any`    | No       | —           |
| `query`   | `object` | No       | —           |
| `headers` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="query full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>

  <Accordion title="headers full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output:** `object[]`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
    } | any[]
    ```
  </Accordion>
</AccordionGroup>

***
