# ImportsApi

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

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**createImport**](#createimport) | **POST** /imports/{type} | Start a bulk data import|
|[**getImport**](#getimport) | **GET** /imports/{importId} | Get a single import|
|[**getImportItems**](#getimportitems) | **GET** /imports/{importId}/items | List the rows in an import job|
|[**getImports**](#getimports) | **GET** /imports | List bulk import jobs|

# **createImport**
> GetImport200Response createImport()

Starts an asynchronous import job of the given type (currently \"account-tiers\") that queues each supplied row for background processing, such as assigning a tier to accounts by email, and requires the \"update\" permission on the organization.

### Example

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

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

let type: string; //The type identifier (default to undefined)
let _import: ImportCreateInputs; //Filter by import (default to undefined)
let messageData: object; //Filter by messageData (optional) (default to undefined)

const { status, data } = await apiInstance.createImport(
    type,
    _import,
    messageData
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **type** | [**string**] | The type identifier | defaults to undefined|
| **_import** | **ImportCreateInputs** | Filter by import | defaults to undefined|
| **messageData** | **object** | Filter by messageData | (optional) defaults to undefined|


### Return type

**GetImport200Response**

### 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)

# **getImport**
> GetImport200Response getImport()

Returns the details and status of a single bulk import job by its ID; requires organization-level read access.

### Example

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

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

let importId: string; //The import identifier (default to undefined)

const { status, data } = await apiInstance.getImport(
    importId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **importId** | [**string**] | The import identifier | defaults to undefined|


### Return type

**GetImport200Response**

### 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)

# **getImportItems**
> GetImportItems200Response getImportItems()

Returns a paginated list of individual row items belonging to the given import job, along with each item\'s processing result, and supports search (e.g. by email for account-tier imports); requires organization-level read access.

### Example

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

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

let importId: string; //The import identifier (default to undefined)
let status: ImportItemStatus; //Filter by status (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.getImportItems(
    importId,
    status,
    page,
    pageSize,
    orderBy,
    search
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **importId** | [**string**] | The import identifier | defaults to undefined|
| **status** | **ImportItemStatus** | Filter by status | (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

**GetImportItems200Response**

### 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)

# **getImports**
> GetImports200Response getImports()

Returns a paginated list of bulk import jobs for the organization, optionally filtered by tier and searchable by import type; requires organization-level read access.

### Example

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

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

let tierId: string; //Filter by tierId (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.getImports(
    tierId,
    page,
    pageSize,
    orderBy,
    search
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **tierId** | [**string**] | Filter by tierId | (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

**GetImports200Response**

### 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)

