# AccountsLeadsApi

All URIs are relative to *https://admin-api.connected.dev*

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**deleteAccountLead**](#deleteaccountlead) | **DELETE** /accounts/{accountId}/leads/{leadId} | Delete an account\&#39;s lead|
|[**getAccountLead**](#getaccountlead) | **GET** /accounts/{accountId}/leads/{leadId} | Get a single account lead|
|[**getAccountLeads**](#getaccountleads) | **GET** /accounts/{accountId}/leads | List an account\&#39;s leads|
|[**updateAccountLead**](#updateaccountlead) | **PUT** /accounts/{accountId}/leads/{leadId} | Update an account\&#39;s lead|

# **deleteAccountLead**
> CreateAccountInvitations200Response deleteAccountLead()

Permanently deletes the specified lead record captured by the given account; requires update permission on accounts.

### Example

```typescript
import {
    AccountsLeadsApi,
    Configuration
} from '@connectedxm/admin-sdk';

const configuration = new Configuration();
const apiInstance = new AccountsLeadsApi(configuration);

let accountId: string; //The account identifier (default to undefined)
let leadId: string; //The lead identifier (default to undefined)

const { status, data } = await apiInstance.deleteAccountLead(
    accountId,
    leadId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **accountId** | [**string**] | The account identifier | defaults to undefined|
| **leadId** | [**string**] | The lead identifier | defaults to undefined|


### Return type

**CreateAccountInvitations200Response**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth), [OrganizationId](../README.md#OrganizationId)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Successful response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **getAccountLead**
> GetAccountLead200Response getAccountLead()

Retrieves one lead record captured by the specified account by its lead ID, and requires permission to read accounts.

### Example

```typescript
import {
    AccountsLeadsApi,
    Configuration
} from '@connectedxm/admin-sdk';

const configuration = new Configuration();
const apiInstance = new AccountsLeadsApi(configuration);

let accountId: string; //The account identifier (default to undefined)
let leadId: string; //The lead identifier (default to undefined)

const { status, data } = await apiInstance.getAccountLead(
    accountId,
    leadId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **accountId** | [**string**] | The account identifier | defaults to undefined|
| **leadId** | [**string**] | The lead identifier | defaults to undefined|


### Return type

**GetAccountLead200Response**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth), [OrganizationId](../README.md#OrganizationId)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Successful response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **getAccountLeads**
> GetAccountLeads200Response getAccountLeads()

Returns a paginated list of leads captured by the given account, optionally filtered by lead status or by the event where they were captured, with search over the lead\'s name, title, company, or email; requires read access to accounts.

### Example

```typescript
import {
    AccountsLeadsApi,
    Configuration
} from '@connectedxm/admin-sdk';

const configuration = new Configuration();
const apiInstance = new AccountsLeadsApi(configuration);

let accountId: string; //The account identifier (default to undefined)
let status: LeadStatus; //Filter by status (optional) (default to undefined)
let eventId: string; //Filter by eventId (optional) (default to undefined)
let page: number; //Page number (optional) (default to 1)
let pageSize: number; //Number of items per page (optional) (default to 25)
let orderBy: string; //Field to order by (optional) (default to undefined)
let search: string; //Search query (optional) (default to undefined)

const { status, data } = await apiInstance.getAccountLeads(
    accountId,
    status,
    eventId,
    page,
    pageSize,
    orderBy,
    search
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **accountId** | [**string**] | The account identifier | defaults to undefined|
| **status** | **LeadStatus** | Filter by status | (optional) defaults to undefined|
| **eventId** | [**string**] | Filter by eventId | (optional) defaults to undefined|
| **page** | [**number**] | Page number | (optional) defaults to 1|
| **pageSize** | [**number**] | Number of items per page | (optional) defaults to 25|
| **orderBy** | [**string**] | Field to order by | (optional) defaults to undefined|
| **search** | [**string**] | Search query | (optional) defaults to undefined|


### Return type

**GetAccountLeads200Response**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth), [OrganizationId](../README.md#OrganizationId)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Successful response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **updateAccountLead**
> GetAccountLead200Response updateAccountLead(leadUpdateInputs)

Updates fields (such as status or contact details) on the specified lead captured by the given account and returns the updated lead; requires update permission on accounts.

### Example

```typescript
import {
    AccountsLeadsApi,
    Configuration,
    LeadUpdateInputs
} from '@connectedxm/admin-sdk';

const configuration = new Configuration();
const apiInstance = new AccountsLeadsApi(configuration);

let accountId: string; //The account identifier (default to undefined)
let leadId: string; //The lead identifier (default to undefined)
let leadUpdateInputs: LeadUpdateInputs; //

const { status, data } = await apiInstance.updateAccountLead(
    accountId,
    leadId,
    leadUpdateInputs
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **leadUpdateInputs** | **LeadUpdateInputs**|  | |
| **accountId** | [**string**] | The account identifier | defaults to undefined|
| **leadId** | [**string**] | The lead identifier | defaults to undefined|


### Return type

**GetAccountLead200Response**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth), [OrganizationId](../README.md#OrganizationId)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Successful response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

