> ## 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 Emelia: every `emelia.api.*` operation with input and output types.

Every `emelia.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>

## Account

### me

`account.me`

Retrieve authenticated Emelia account details

**Risk:** `read`

```ts theme={null}
await corsair.emelia.api.account.me({});
```

**Input:** *empty object*

**Output**

| Name | Type     | Required | Description |
| ---- | -------- | -------- | ----------- |
| `me` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="me full type">
    ```ts theme={null}
    {
      uid?: string,
      name?: string,
      email?: string,
      showMailbox?: boolean,
      picture?: string,
      due_invoice?: boolean,
      joinedDate?: string
    }
    ```
  </Accordion>
</AccordionGroup>

***

## Blacklist

### add

`blacklist.add`

Add a contact to the email blacklist

**Risk:** `write`

```ts theme={null}
await corsair.emelia.api.blacklist.add({});
```

**Input**

| Name    | Type     | Required | Description |
| ------- | -------- | -------- | ----------- |
| `email` | `string` | Yes      | —           |

**Output**

| Name      | Type      | Required | Description |
| --------- | --------- | -------- | ----------- |
| `success` | `boolean` | No       | —           |
| `message` | `string`  | No       | —           |

***

### remove

`blacklist.remove`

Remove a contact from the email blacklist

**Risk:** `destructive`

```ts theme={null}
await corsair.emelia.api.blacklist.remove({});
```

**Input**

| Name    | Type     | Required | Description |
| ------- | -------- | -------- | ----------- |
| `email` | `string` | Yes      | —           |

**Output**

| Name      | Type      | Required | Description |
| --------- | --------- | -------- | ----------- |
| `success` | `boolean` | No       | —           |
| `message` | `string`  | No       | —           |

***

## Campaigns

### addContact

`campaigns.addContact`

Add a contact to a campaign

**Risk:** `write`

```ts theme={null}
await corsair.emelia.api.campaigns.addContact({});
```

**Input**

| Name      | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `id`      | `string` | Yes      | —           |
| `contact` | `object` | Yes      | —           |

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

**Output**

| Name                       | Type  | Required | Description |
| -------------------------- | ----- | -------- | ----------- |
| `addContactToCampaignHook` | `any` | No       | —           |

***

### list

`campaigns.list`

List all cold outreach campaigns

**Risk:** `read`

```ts theme={null}
await corsair.emelia.api.campaigns.list({});
```

**Input**

| Name      | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `options` | `object` | No       | —           |

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

**Output**

| Name            | Type       | Required | Description |
| --------------- | ---------- | -------- | ----------- |
| `all_campaigns` | `object[]` | No       | —           |

<AccordionGroup>
  <Accordion title="all_campaigns full type">
    ```ts theme={null}
    {
      _id: string,
      name?: string,
      status?: string,
      createdAt?: string,
      provider?: string,
      useManyProviders?: boolean,
      plannedStart?: string
    }[]
    ```
  </Accordion>
</AccordionGroup>

***

### removeContact

`campaigns.removeContact`

Remove a contact from a campaign

**Risk:** `destructive`

```ts theme={null}
await corsair.emelia.api.campaigns.removeContact({});
```

**Input**

| Name    | Type     | Required | Description |
| ------- | -------- | -------- | ----------- |
| `id`    | `string` | Yes      | —           |
| `email` | `string` | Yes      | —           |

**Output**

| Name                           | Type  | Required | Description |
| ------------------------------ | ----- | -------- | ----------- |
| `removeOneContactFromCampaign` | `any` | No       | —           |

***

## Contacts

### addToList

`contacts.addToList`

Add a contact to a contact list

**Risk:** `write`

```ts theme={null}
await corsair.emelia.api.contacts.addToList({});
```

**Input**

| Name      | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `id`      | `string` | Yes      | —           |
| `contact` | `object` | Yes      | —           |

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

**Output**

| Name                    | Type  | Required | Description |
| ----------------------- | ----- | -------- | ----------- |
| `addContactsToListHook` | `any` | No       | —           |

***

### listLists

`contacts.listLists`

List all contact lists

**Risk:** `read`

```ts theme={null}
await corsair.emelia.api.contacts.listLists({});
```

**Input:** *empty object*

**Output**

| Name            | Type       | Required | Description |
| --------------- | ---------- | -------- | ----------- |
| `contact_lists` | `object[]` | No       | —           |

<AccordionGroup>
  <Accordion title="contact_lists full type">
    ```ts theme={null}
    {
      _id: string,
      name?: string,
      contactCount?: number,
      fields?: string[],
      usedInCampaign?: boolean
    }[]
    ```
  </Accordion>
</AccordionGroup>

***

## Email Campaigns

### addContact

`emailCampaigns.addContact`

Add a contact to an email campaign (legacy REST)

**Risk:** `write`

```ts theme={null}
await corsair.emelia.api.emailCampaigns.addContact({});
```

**Input**

| Name         | Type     | Required | Description |
| ------------ | -------- | -------- | ----------- |
| `campaignId` | `string` | Yes      | —           |
| `contact`    | `object` | Yes      | —           |

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

**Output**

| Name      | Type      | Required | Description |
| --------- | --------- | -------- | ----------- |
| `success` | `boolean` | No       | —           |
| `message` | `string`  | No       | —           |

***

### deleteContact

`emailCampaigns.deleteContact`

Remove a contact from an email campaign

**Risk:** `destructive`

```ts theme={null}
await corsair.emelia.api.emailCampaigns.deleteContact({});
```

**Input**

| Name         | Type     | Required | Description |
| ------------ | -------- | -------- | ----------- |
| `campaignId` | `string` | Yes      | —           |
| `email`      | `string` | Yes      | —           |

**Output**

| Name      | Type      | Required | Description |
| --------- | --------- | -------- | ----------- |
| `success` | `boolean` | No       | —           |
| `message` | `string`  | No       | —           |

***

### listContacts

`emailCampaigns.listContacts`

List contacts in an email campaign

**Risk:** `read`

```ts theme={null}
await corsair.emelia.api.emailCampaigns.listContacts({});
```

**Input**

| Name         | Type     | Required | Description |
| ------------ | -------- | -------- | ----------- |
| `campaignId` | `string` | No       | —           |
| `page`       | `number` | No       | —           |
| `limit`      | `number` | No       | —           |

**Output:** `object`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
      id?: string,
      email?: string,
      firstName?: string,
      lastName?: string,
      status?: string
    }[] | {
      contacts?: {
        id?: string,
        email?: string,
        firstName?: string,
        lastName?: string,
        status?: string
      }[],
      data?: {
        id?: string,
        email?: string,
        firstName?: string,
        lastName?: string,
        status?: string
      }[],
      total?: number
    }
    ```
  </Accordion>
</AccordionGroup>

***

## Linkedin

### createCampaign

`linkedin.createCampaign`

Create a new LinkedIn campaign

**Risk:** `write`

```ts theme={null}
await corsair.emelia.api.linkedin.createCampaign({});
```

**Input**

| Name   | Type     | Required | Description |
| ------ | -------- | -------- | ----------- |
| `name` | `string` | Yes      | —           |

**Output**

| Name         | Type      | Required | Description |
| ------------ | --------- | -------- | ----------- |
| `success`    | `boolean` | No       | —           |
| `message`    | `string`  | No       | —           |
| `campaignId` | `string`  | No       | —           |
| `id`         | `string`  | No       | —           |
| `name`       | `string`  | No       | —           |

***

### deleteContact

`linkedin.deleteContact`

Delete a contact from a LinkedIn campaign

**Risk:** `destructive`

```ts theme={null}
await corsair.emelia.api.linkedin.deleteContact({});
```

**Input**

| Name         | Type     | Required | Description |
| ------------ | -------- | -------- | ----------- |
| `campaignId` | `string` | No       | —           |
| `contactUrl` | `string` | Yes      | —           |

**Output**

| Name      | Type      | Required | Description |
| --------- | --------- | -------- | ----------- |
| `success` | `boolean` | No       | —           |
| `message` | `string`  | No       | —           |

***

### getActivities

`linkedin.getActivities`

Retrieve activities for a LinkedIn campaign

**Risk:** `read`

```ts theme={null}
await corsair.emelia.api.linkedin.getActivities({});
```

**Input**

| Name         | Type     | Required | Description |
| ------------ | -------- | -------- | ----------- |
| `campaignId` | `string` | Yes      | —           |

**Output:** `object`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
      id?: string,
      type?: string,
      event?: string,
      date?: string,
      step?: number
    }[] | {
      activities?: {
        id?: string,
        type?: string,
        event?: string,
        date?: string,
        step?: number
      }[],
      data?: {
        id?: string,
        type?: string,
        event?: string,
        date?: string,
        step?: number
      }[],
      total?: number
    }
    ```
  </Accordion>
</AccordionGroup>

***

### listCampaigns

`linkedin.listCampaigns`

List all LinkedIn campaigns

**Risk:** `read`

```ts theme={null}
await corsair.emelia.api.linkedin.listCampaigns({});
```

**Input**

| Name    | Type     | Required | Description |
| ------- | -------- | -------- | ----------- |
| `page`  | `number` | No       | —           |
| `limit` | `number` | No       | —           |

**Output:** `object`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
      id?: string,
      campaignId?: string,
      name?: string,
      status?: string
    }[] | {
      campaigns?: {
        id?: string,
        campaignId?: string,
        name?: string,
        status?: string
      }[],
      data?: {
        id?: string,
        campaignId?: string,
        name?: string,
        status?: string
      }[],
      total?: number
    }
    ```
  </Accordion>
</AccordionGroup>

***

## Providers

### list

`providers.list`

List all configured email providers

**Risk:** `read`

```ts theme={null}
await corsair.emelia.api.providers.list({});
```

**Input:** *empty object*

**Output:** `object`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
      id?: string,
      name?: string,
      email?: string,
      type?: string,
      status?: string
    }[] | {
      providers?: {
        id?: string,
        name?: string,
        email?: string,
        type?: string,
        status?: string
      }[],
      data?: {
        id?: string,
        name?: string,
        email?: string,
        type?: string,
        status?: string
      }[]
    }
    ```
  </Accordion>
</AccordionGroup>

***

## Rest Campaigns

### create

`restCampaigns.create`

Create a new email campaign (REST)

**Risk:** `write`

```ts theme={null}
await corsair.emelia.api.restCampaigns.create({});
```

**Input**

| Name   | Type     | Required | Description |
| ------ | -------- | -------- | ----------- |
| `name` | `string` | Yes      | —           |

**Output**

| Name         | Type      | Required | Description |
| ------------ | --------- | -------- | ----------- |
| `success`    | `boolean` | No       | —           |
| `message`    | `string`  | No       | —           |
| `campaignId` | `string`  | No       | —           |
| `id`         | `string`  | No       | —           |
| `name`       | `string`  | No       | —           |

***

### getActivities

`restCampaigns.getActivities`

Retrieve activities for an email campaign

**Risk:** `read`

```ts theme={null}
await corsair.emelia.api.restCampaigns.getActivities({});
```

**Input**

| Name         | Type     | Required | Description |
| ------------ | -------- | -------- | ----------- |
| `campaignId` | `string` | Yes      | —           |
| `page`       | `number` | No       | —           |
| `limit`      | `number` | No       | —           |

**Output:** `object`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
      id?: string,
      type?: string,
      event?: string,
      date?: string,
      step?: number
    }[] | {
      activities?: {
        id?: string,
        type?: string,
        event?: string,
        date?: string,
        step?: number
      }[],
      data?: {
        id?: string,
        type?: string,
        event?: string,
        date?: string,
        step?: number
      }[],
      total?: number
    }
    ```
  </Accordion>
</AccordionGroup>

***

### list

`restCampaigns.list`

List all email campaigns (REST)

**Risk:** `read`

```ts theme={null}
await corsair.emelia.api.restCampaigns.list({});
```

**Input**

| Name    | Type     | Required | Description |
| ------- | -------- | -------- | ----------- |
| `page`  | `number` | No       | —           |
| `limit` | `number` | No       | —           |

**Output:** `object`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
      id?: string,
      campaignId?: string,
      name?: string,
      status?: string
    }[] | {
      campaigns?: {
        id?: string,
        campaignId?: string,
        name?: string,
        status?: string
      }[],
      data?: {
        id?: string,
        campaignId?: string,
        name?: string,
        status?: string
      }[],
      total?: number,
      page?: number,
      limit?: number
    }
    ```
  </Accordion>
</AccordionGroup>

***

## Tools

### findEmailSingle

`tools.findEmailSingle`

Initiate a find-email job for a single contact

**Risk:** `write`

```ts theme={null}
await corsair.emelia.api.tools.findEmailSingle({});
```

**Input**

| Name             | Type     | Required | Description |
| ---------------- | -------- | -------- | ----------- |
| `fullname`       | `string` | Yes      | —           |
| `companyName`    | `string` | Yes      | —           |
| `companyWebsite` | `string` | No       | —           |
| `country`        | `string` | No       | —           |

**Output**

| Name      | Type      | Required | Description |
| --------- | --------- | -------- | ----------- |
| `success` | `boolean` | Yes      | —           |
| `jobId`   | `string`  | Yes      | —           |

***

### findPhoneSingle

`tools.findPhoneSingle`

Initiate a phone-find job for a single contact

**Risk:** `write`

```ts theme={null}
await corsair.emelia.api.tools.findPhoneSingle({});
```

**Input**

| Name          | Type     | Required | Description |
| ------------- | -------- | -------- | ----------- |
| `linkedinUrl` | `string` | Yes      | —           |

**Output**

| Name      | Type      | Required | Description |
| --------- | --------- | -------- | ----------- |
| `success` | `boolean` | Yes      | —           |
| `jobId`   | `string`  | Yes      | —           |

***

### getFindEmailResult

`tools.getFindEmailResult`

Retrieve the result of a find-email job

**Risk:** `read`

```ts theme={null}
await corsair.emelia.api.tools.getFindEmailResult({});
```

**Input**

| Name    | Type     | Required | Description |
| ------- | -------- | -------- | ----------- |
| `jobId` | `string` | Yes      | —           |

**Output**

| Name      | Type      | Required | Description |
| --------- | --------- | -------- | ----------- |
| `success` | `boolean` | Yes      | —           |
| `data`    | `object`  | Yes      | —           |

<AccordionGroup>
  <Accordion title="data full type">
    ```ts theme={null}
    {
      fullname?: string,
      companyName?: string,
      companyWebsite?: string,
      email: string,
      qualification?: valid | invalid,
      status: running | done | error,
      date?: string
    }
    ```
  </Accordion>
</AccordionGroup>

***

### getFindPhoneResult

`tools.getFindPhoneResult`

Retrieve the result of a phone-find job

**Risk:** `read`

```ts theme={null}
await corsair.emelia.api.tools.getFindPhoneResult({});
```

**Input**

| Name    | Type     | Required | Description |
| ------- | -------- | -------- | ----------- |
| `jobId` | `string` | Yes      | —           |

**Output**

| Name      | Type      | Required | Description |
| --------- | --------- | -------- | ----------- |
| `success` | `boolean` | Yes      | —           |
| `data`    | `object`  | Yes      | —           |

<AccordionGroup>
  <Accordion title="data full type">
    ```ts theme={null}
    {
      linkedinUrl: string,
      phoneNumber?: string,
      country?: string,
      qualification?: found | not_found,
      status: running | done | error,
      date?: string
    }
    ```
  </Accordion>
</AccordionGroup>

***

### getVerifyEmailResult

`tools.getVerifyEmailResult`

Retrieve the result of an email verification job

**Risk:** `read`

```ts theme={null}
await corsair.emelia.api.tools.getVerifyEmailResult({});
```

**Input**

| Name    | Type     | Required | Description |
| ------- | -------- | -------- | ----------- |
| `jobId` | `string` | Yes      | —           |

**Output**

| Name      | Type      | Required | Description |
| --------- | --------- | -------- | ----------- |
| `success` | `boolean` | Yes      | —           |
| `data`    | `object`  | Yes      | —           |

<AccordionGroup>
  <Accordion title="data full type">
    ```ts theme={null}
    {
      email: string,
      qualification?: valid | invalid,
      status: running | done | error,
      date?: string
    }
    ```
  </Accordion>
</AccordionGroup>

***

### verifyEmailSingle

`tools.verifyEmailSingle`

Initiate an email verification job

**Risk:** `write`

```ts theme={null}
await corsair.emelia.api.tools.verifyEmailSingle({});
```

**Input**

| Name    | Type     | Required | Description |
| ------- | -------- | -------- | ----------- |
| `email` | `string` | Yes      | —           |

**Output**

| Name      | Type      | Required | Description |
| --------- | --------- | -------- | ----------- |
| `success` | `boolean` | Yes      | —           |
| `jobId`   | `string`  | Yes      | —           |

***

## Webhooks

### create

`webhooks.create`

Create a webhook for campaign events

**Risk:** `write`

```ts theme={null}
await corsair.emelia.api.webhooks.create({});
```

**Input**

| Name         | Type       | Required | Description |
| ------------ | ---------- | -------- | ----------- |
| `campaignId` | `string`   | Yes      | —           |
| `url`        | `string`   | Yes      | —           |
| `events`     | `string[]` | Yes      | —           |

**Output**

| Name      | Type      | Required | Description |
| --------- | --------- | -------- | ----------- |
| `success` | `boolean` | No       | —           |
| `message` | `string`  | No       | —           |
| `id`      | `string`  | No       | —           |
| `url`     | `string`  | No       | —           |

***

### list

`webhooks.list`

List all webhooks

**Risk:** `read`

```ts theme={null}
await corsair.emelia.api.webhooks.list({});
```

**Input:** *empty object*

**Output:** `object`

<AccordionGroup>
  <Accordion title="Output full type">
    ```ts theme={null}
    {
      id?: string,
      url?: string,
      webhookUrl?: string,
      campaignId?: string,
      events?: string[]
    }[] | {
      webhooks?: {
        id?: string,
        url?: string,
        webhookUrl?: string,
        campaignId?: string,
        events?: string[]
      }[],
      data?: {
        id?: string,
        url?: string,
        webhookUrl?: string,
        campaignId?: string,
        events?: string[]
      }[]
    }
    ```
  </Accordion>
</AccordionGroup>

***

### remove

`webhooks.remove`

Delete a webhook by URL

**Risk:** `destructive`

```ts theme={null}
await corsair.emelia.api.webhooks.remove({});
```

**Input**

| Name  | Type     | Required | Description |
| ----- | -------- | -------- | ----------- |
| `url` | `string` | Yes      | —           |

**Output**

| Name      | Type      | Required | Description |
| --------- | --------- | -------- | ----------- |
| `success` | `boolean` | No       | —           |
| `message` | `string`  | No       | —           |

***
