# ClientApi

All URIs are relative to *http://0.0.0.0:3000*

| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**apiKeysGet**](ClientApi.md#apikeysget) | **GET** /api-keys | Get all API keys for the authenticated user |
| [**apiKeysIdDelete**](ClientApi.md#apikeysiddelete) | **DELETE** /api-keys/{id} | Delete an API key |
| [**apiKeysPost**](ClientApi.md#apikeyspost) | **POST** /api-keys | Create a new API key |
| [**apiSendEmail**](ClientApi.md#apisendemail) | **POST** /api/applications/{applicationId}/emails/send | Send an email |
| [**createAccount**](ClientApi.md#createaccount) | **POST** /accounts | Creates a new account |
| [**createApplication**](ClientApi.md#createapplication) | **POST** /applications | Create a new application |
| [**deleteApplication**](ClientApi.md#deleteapplication) | **DELETE** /applications/{applicationId} | Delete an application |
| [**deleteTemplate**](ClientApi.md#deletetemplate) | **DELETE** /applications/{applicationId}/templates/{id} | Delete an template |
| [**getApplicationByID**](ClientApi.md#getapplicationbyid) | **GET** /applications/{applicationId} | Get an application by applicationId |
| [**getApplications**](ClientApi.md#getapplications) | **GET** /applications | Get all applications for the account |
| [**getTemplate**](ClientApi.md#gettemplate) | **GET** /applications/{applicationId}/templates/{id} | Return a template |
| [**getTemplates**](ClientApi.md#gettemplates) | **GET** /applications/{applicationId}/templates | Return all templates |
| [**sendEmail**](ClientApi.md#sendemail) | **POST** /applications/{applicationId}/emails/send | Send an email |
| [**updateApplication**](ClientApi.md#updateapplication) | **PATCH** /applications/{applicationId} | Update an application |
| [**updateTemplate**](ClientApi.md#updatetemplate) | **PATCH** /applications/{applicationId}/templates/{id} | Update a template |
| [**uploadTemplate**](ClientApi.md#uploadtemplate) | **POST** /applications/{applicationId}/templates | Upload a template |



## apiKeysGet

> GetAPIKeysResponseDTO apiKeysGet(page, pageSize)

Get all API keys for the authenticated user

Retrieve all API keys associated with the authenticated user\&#39;s account with pagination.

### Example

```ts
import {
  Configuration,
  ClientApi,
} from '';
import type { ApiKeysGetRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const config = new Configuration({ 
    // To configure API key authorization: auth0JWT
    apiKey: "YOUR API KEY",
  });
  const api = new ClientApi(config);

  const body = {
    // number | Page number for pagination(default: 1) (optional)
    page: 56,
    // number | Limit number of items per page (default: 10) (optional)
    pageSize: 56,
  } satisfies ApiKeysGetRequest;

  try {
    const data = await api.apiKeysGet(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);
```

### Parameters


| Name | Type | Description  | Notes |
|------------- | ------------- | ------------- | -------------|
| **page** | `number` | Page number for pagination(default: 1) | [Optional] [Defaults to `1`] |
| **pageSize** | `number` | Limit number of items per page (default: 10) | [Optional] [Defaults to `10`] |

### Return type

[**GetAPIKeysResponseDTO**](GetAPIKeysResponseDTO.md)

### Authorization

[auth0JWT](../README.md#auth0JWT)

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | Returns a paginated list of API keys |  -  |
| **401** | Unauthorized |  -  |
| **402** | Return an error if the trial access has expired |  -  |
| **500** | Internal server error: Failed to retrieve API keys |  -  |

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


## apiKeysIdDelete

> apiKeysIdDelete(id)

Delete an API key

Delete a specific API key belonging to the authenticated user.

### Example

```ts
import {
  Configuration,
  ClientApi,
} from '';
import type { ApiKeysIdDeleteRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const config = new Configuration({ 
    // To configure API key authorization: auth0JWT
    apiKey: "YOUR API KEY",
  });
  const api = new ClientApi(config);

  const body = {
    // string | API Key ID
    id: id_example,
  } satisfies ApiKeysIdDeleteRequest;

  try {
    const data = await api.apiKeysIdDelete(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);
```

### Parameters


| Name | Type | Description  | Notes |
|------------- | ------------- | ------------- | -------------|
| **id** | `string` | API Key ID | [Defaults to `undefined`] |

### Return type

`void` (Empty response body)

### Authorization

[auth0JWT](../README.md#auth0JWT)

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **204** | API key deleted successfully |  -  |
| **400** | Invalid key ID format |  -  |
| **401** | Unauthorized |  -  |
| **402** | Return an error if the trial access has expired |  -  |
| **404** | API key not found |  -  |
| **500** | Internal server error: Failed to delete API key |  -  |

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


## apiKeysPost

> CreateAPIKeyResponseDTO apiKeysPost(createAPIKeyRequestDTO)

Create a new API key

Create a new API key for accessing the RAG service.

### Example

```ts
import {
  Configuration,
  ClientApi,
} from '';
import type { ApiKeysPostRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const config = new Configuration({ 
    // To configure API key authorization: auth0JWT
    apiKey: "YOUR API KEY",
  });
  const api = new ClientApi(config);

  const body = {
    // CreateAPIKeyRequestDTO | Create API Key request
    createAPIKeyRequestDTO: ...,
  } satisfies ApiKeysPostRequest;

  try {
    const data = await api.apiKeysPost(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);
```

### Parameters


| Name | Type | Description  | Notes |
|------------- | ------------- | ------------- | -------------|
| **createAPIKeyRequestDTO** | [CreateAPIKeyRequestDTO](CreateAPIKeyRequestDTO.md) | Create API Key request | |

### Return type

[**CreateAPIKeyResponseDTO**](CreateAPIKeyResponseDTO.md)

### Authorization

[auth0JWT](../README.md#auth0JWT)

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **201** | Create an API key and returns the created key |  -  |
| **400** | Invalid request format |  -  |
| **401** | Unauthorized |  -  |
| **402** | Return an error if the trial access has expired |  -  |
| **500** | Server Error: Failed to create API key |  -  |

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


## apiSendEmail

> apiSendEmail(applicationId, templateUUID, to, body, data, file)

Send an email

Send an email

### Example

```ts
import {
  Configuration,
  ClientApi,
} from '';
import type { ApiSendEmailRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const config = new Configuration({ 
    // To configure API key authorization: api_key
    apiKey: "YOUR API KEY",
  });
  const api = new ClientApi(config);

  const body = {
    // string | Application ID
    applicationId: applicationId_example,
    // string | TemplateUUID
    templateUUID: templateUUID_example,
    // string | To
    to: to_example,
    // string | Body (optional)
    body: body_example,
    // string | Data (optional)
    data: data_example,
    // Blob | File (optional)
    file: BINARY_DATA_HERE,
  } satisfies ApiSendEmailRequest;

  try {
    const data = await api.apiSendEmail(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);
```

### Parameters


| Name | Type | Description  | Notes |
|------------- | ------------- | ------------- | -------------|
| **applicationId** | `string` | Application ID | [Defaults to `undefined`] |
| **templateUUID** | `string` | TemplateUUID | [Defaults to `undefined`] |
| **to** | `string` | To | [Defaults to `undefined`] |
| **body** | `string` | Body | [Optional] [Defaults to `undefined`] |
| **data** | `string` | Data | [Optional] [Defaults to `undefined`] |
| **file** | `Blob` | File | [Optional] [Defaults to `undefined`] |

### Return type

`void` (Empty response body)

### Authorization

[api_key](../README.md#api_key)

### HTTP request headers

- **Content-Type**: `multipart/form-data`
- **Accept**: `application/json`


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **202** | Email was sent |  -  |
| **400** | Return an error if there is a missing or invalid field |  -  |
| **401** | Return an error if the user is not authorized |  -  |
| **402** | Return an error if the trial access has expired |  -  |
| **403** | Return an error if the user does not have the required permissions |  -  |
| **404** | Return an error if the template is not found |  -  |
| **500** | Return an error if an internal error occurs |  -  |

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


## createAccount

> AccountDTO createAccount(createAccountDTO)

Creates a new account

Create an account

### Example

```ts
import {
  Configuration,
  ClientApi,
} from '';
import type { CreateAccountRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const config = new Configuration({ 
    // To configure API key authorization: auth0JWT
    apiKey: "YOUR API KEY",
  });
  const api = new ClientApi(config);

  const body = {
    // CreateAccountDTO | Account creation data
    createAccountDTO: ...,
  } satisfies CreateAccountRequest;

  try {
    const data = await api.createAccount(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);
```

### Parameters


| Name | Type | Description  | Notes |
|------------- | ------------- | ------------- | -------------|
| **createAccountDTO** | [CreateAccountDTO](CreateAccountDTO.md) | Account creation data | |

### Return type

[**AccountDTO**](AccountDTO.md)

### Authorization

[auth0JWT](../README.md#auth0JWT)

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **201** | Create an account and returns the created account |  -  |
| **400** | Return an error if there is a missing or invalid field |  -  |
| **401** | Return an error if the user is not authenticated |  -  |
| **402** | Return an error if the trial access has expired |  -  |
| **403** | Return an error if the user does not have the required permissions |  -  |
| **500** | Return an error if the server finds an error |  -  |

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


## createApplication

> ApplicationDTO createApplication(createApplicationDTO)

Create a new application

Create a new application for the authenticated account. It accepts a smtpConfiguration object to create the SMTP configuration in the same request.

### Example

```ts
import {
  Configuration,
  ClientApi,
} from '';
import type { CreateApplicationRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const config = new Configuration({ 
    // To configure API key authorization: auth0JWT
    apiKey: "YOUR API KEY",
  });
  const api = new ClientApi(config);

  const body = {
    // CreateApplicationDTO | Application creation data, it includes a SMTP configuration
    createApplicationDTO: ...,
  } satisfies CreateApplicationRequest;

  try {
    const data = await api.createApplication(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);
```

### Parameters


| Name | Type | Description  | Notes |
|------------- | ------------- | ------------- | -------------|
| **createApplicationDTO** | [CreateApplicationDTO](CreateApplicationDTO.md) | Application creation data, it includes a SMTP configuration | |

### Return type

[**ApplicationDTO**](ApplicationDTO.md)

### Authorization

[auth0JWT](../README.md#auth0JWT)

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **201** | Create a application and returns the created application |  -  |
| **400** | Return an error if there is a missing or invalid field |  -  |
| **401** | Return an error if the user is not authenticated |  -  |
| **402** | Return an error if the trial access has expired |  -  |
| **403** | Return an error if the user does not have the required permissions |  -  |
| **500** | Return an error if the server founds an error |  -  |

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


## deleteApplication

> deleteApplication(applicationId)

Delete an application

Delete an application belonging to the authenticated account

### Example

```ts
import {
  Configuration,
  ClientApi,
} from '';
import type { DeleteApplicationRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const config = new Configuration({ 
    // To configure API key authorization: auth0JWT
    apiKey: "YOUR API KEY",
  });
  const api = new ClientApi(config);

  const body = {
    // string | Application ID
    applicationId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
  } satisfies DeleteApplicationRequest;

  try {
    const data = await api.deleteApplication(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);
```

### Parameters


| Name | Type | Description  | Notes |
|------------- | ------------- | ------------- | -------------|
| **applicationId** | `string` | Application ID | [Defaults to `undefined`] |

### Return type

`void` (Empty response body)

### Authorization

[auth0JWT](../README.md#auth0JWT)

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **204** | Application deleted |  -  |
| **400** | Return an error if provided ID is not a valid UUID |  -  |
| **401** | Return an error if the user is not authenticated |  -  |
| **402** | Return an error if the trial access has expired |  -  |
| **403** | Return an error if the user does not have the required permissions |  -  |
| **500** | Return an error if the server founds an error |  -  |

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


## deleteTemplate

> deleteTemplate(id, applicationId)

Delete an template

Delete an template

### Example

```ts
import {
  Configuration,
  ClientApi,
} from '';
import type { DeleteTemplateRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const config = new Configuration({ 
    // To configure API key authorization: auth0JWT
    apiKey: "YOUR API KEY",
  });
  const api = new ClientApi(config);

  const body = {
    // string | Template ID
    id: id_example,
    // string | Application ID
    applicationId: applicationId_example,
  } satisfies DeleteTemplateRequest;

  try {
    const data = await api.deleteTemplate(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);
```

### Parameters


| Name | Type | Description  | Notes |
|------------- | ------------- | ------------- | -------------|
| **id** | `string` | Template ID | [Defaults to `undefined`] |
| **applicationId** | `string` | Application ID | [Defaults to `undefined`] |

### Return type

`void` (Empty response body)

### Authorization

[auth0JWT](../README.md#auth0JWT)

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **204** | Template deleted successfully |  -  |
| **400** | Return an error if there is a missing or invalid field |  -  |
| **401** | Return an error if the user is not authorized |  -  |
| **402** | Return an error if the trial access has expired |  -  |
| **404** | Return an error if email template not found |  -  |
| **500** | Return an error if an internal error occurs |  -  |

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


## getApplicationByID

> ApplicationDTO getApplicationByID(applicationId)

Get an application by applicationId

Get a specific application belonging to the authenticated account, including its SMTP configuration when one exists

### Example

```ts
import {
  Configuration,
  ClientApi,
} from '';
import type { GetApplicationByIDRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const config = new Configuration({ 
    // To configure API key authorization: auth0JWT
    apiKey: "YOUR API KEY",
  });
  const api = new ClientApi(config);

  const body = {
    // string | Application ID
    applicationId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
  } satisfies GetApplicationByIDRequest;

  try {
    const data = await api.getApplicationByID(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);
```

### Parameters


| Name | Type | Description  | Notes |
|------------- | ------------- | ------------- | -------------|
| **applicationId** | `string` | Application ID | [Defaults to `undefined`] |

### Return type

[**ApplicationDTO**](ApplicationDTO.md)

### Authorization

[auth0JWT](../README.md#auth0JWT)

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | Return an application |  -  |
| **400** | Return an error if provided ID is not a valid UUID |  -  |
| **401** | Return an error if the user is not authenticated |  -  |
| **402** | Return an error if the trial access has expired |  -  |
| **403** | Return an error if the user does not have the required permissions |  -  |
| **404** | Return an error if the application is not found |  -  |
| **500** | Return an error if the server founds an error |  -  |

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


## getApplications

> PaginatedApplicationsDTO getApplications(page, pageSize, search, sortBy, sortDirection)

Get all applications for the account

Get all applications belonging to the authenticated account

### Example

```ts
import {
  Configuration,
  ClientApi,
} from '';
import type { GetApplicationsRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const config = new Configuration({ 
    // To configure API key authorization: auth0JWT
    apiKey: "YOUR API KEY",
  });
  const api = new ClientApi(config);

  const body = {
    // number | Page number for pagination (optional)
    page: 56,
    // number | Limit number of items per page (optional)
    pageSize: 56,
    // string | Search applications by name, description or id (case-insensitive partial match) (optional)
    search: search_example,
    // 'name' | 'createdAt' | 'updatedAt' | Field to sort by (optional)
    sortBy: sortBy_example,
    // 'asc' | 'desc' | Sort direction (optional)
    sortDirection: sortDirection_example,
  } satisfies GetApplicationsRequest;

  try {
    const data = await api.getApplications(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);
```

### Parameters


| Name | Type | Description  | Notes |
|------------- | ------------- | ------------- | -------------|
| **page** | `number` | Page number for pagination | [Optional] [Defaults to `1`] |
| **pageSize** | `number` | Limit number of items per page | [Optional] [Defaults to `10`] |
| **search** | `string` | Search applications by name, description or id (case-insensitive partial match) | [Optional] [Defaults to `undefined`] |
| **sortBy** | `name`, `createdAt`, `updatedAt` | Field to sort by | [Optional] [Defaults to `undefined`] [Enum: name, createdAt, updatedAt] |
| **sortDirection** | `asc`, `desc` | Sort direction | [Optional] [Defaults to `&#39;asc&#39;`] [Enum: asc, desc] |

### Return type

[**PaginatedApplicationsDTO**](PaginatedApplicationsDTO.md)

### Authorization

[auth0JWT](../README.md#auth0JWT)

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | Return a list of applications |  -  |
| **400** | Return an error if sortBy or sortDirection is invalid |  -  |
| **401** | Return an error if the user is not authenticated |  -  |
| **402** | Return an error if the trial access has expired |  -  |
| **403** | Return an error if the user does not have the required permissions |  -  |
| **500** | Return an error if the server founds an error |  -  |

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


## getTemplate

> EmailTemplateContentDTO getTemplate(id, applicationId)

Return a template

Return a template with all its properties, including the content

### Example

```ts
import {
  Configuration,
  ClientApi,
} from '';
import type { GetTemplateRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const config = new Configuration({ 
    // To configure API key authorization: auth0JWT
    apiKey: "YOUR API KEY",
  });
  const api = new ClientApi(config);

  const body = {
    // string | Email template ID
    id: id_example,
    // string | Application ID
    applicationId: applicationId_example,
  } satisfies GetTemplateRequest;

  try {
    const data = await api.getTemplate(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);
```

### Parameters


| Name | Type | Description  | Notes |
|------------- | ------------- | ------------- | -------------|
| **id** | `string` | Email template ID | [Defaults to `undefined`] |
| **applicationId** | `string` | Application ID | [Defaults to `undefined`] |

### Return type

[**EmailTemplateContentDTO**](EmailTemplateContentDTO.md)

### Authorization

[auth0JWT](../README.md#auth0JWT)

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | Email template |  -  |
| **401** | Return an error if the user is not authorized |  -  |
| **402** | Return an error if the trial access has expired |  -  |
| **403** | Return an error if the user does not have the required permissions |  -  |
| **404** | Return an error if template is not found |  -  |
| **500** | Return an error if an internal error occurs |  -  |

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


## getTemplates

> PaginatedEmailTemplateDTO getTemplates(applicationId, page, pageSize, search, sortBy, sortDirection)

Return all templates

Return all templates

### Example

```ts
import {
  Configuration,
  ClientApi,
} from '';
import type { GetTemplatesRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const config = new Configuration({ 
    // To configure API key authorization: auth0JWT
    apiKey: "YOUR API KEY",
  });
  const api = new ClientApi(config);

  const body = {
    // string | Application ID
    applicationId: applicationId_example,
    // number | Page number for pagination (optional)
    page: 56,
    // number | Limit number of items per page (optional)
    pageSize: 56,
    // string | Search templates by name, id or default email (case-insensitive partial match) (optional)
    search: search_example,
    // 'name' | 'updatedAt' | 'createdAt' | Field to sort by (optional)
    sortBy: sortBy_example,
    // 'asc' | 'desc' | Sort direction (optional)
    sortDirection: sortDirection_example,
  } satisfies GetTemplatesRequest;

  try {
    const data = await api.getTemplates(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);
```

### Parameters


| Name | Type | Description  | Notes |
|------------- | ------------- | ------------- | -------------|
| **applicationId** | `string` | Application ID | [Defaults to `undefined`] |
| **page** | `number` | Page number for pagination | [Optional] [Defaults to `undefined`] |
| **pageSize** | `number` | Limit number of items per page | [Optional] [Defaults to `undefined`] |
| **search** | `string` | Search templates by name, id or default email (case-insensitive partial match) | [Optional] [Defaults to `undefined`] |
| **sortBy** | `name`, `updatedAt`, `createdAt` | Field to sort by | [Optional] [Defaults to `undefined`] [Enum: name, updatedAt, createdAt] |
| **sortDirection** | `asc`, `desc` | Sort direction | [Optional] [Defaults to `&#39;asc&#39;`] [Enum: asc, desc] |

### Return type

[**PaginatedEmailTemplateDTO**](PaginatedEmailTemplateDTO.md)

### Authorization

[auth0JWT](../README.md#auth0JWT)

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | OK |  -  |
| **400** | Return an error if sortBy or sortDirection is invalid |  -  |
| **401** | Return an error if the user is not authorized |  -  |
| **402** | Return an error if the trial access has expired |  -  |
| **403** | Return an error if the user does not have the required permissions |  -  |
| **500** | Return an error if an internal error occurs |  -  |

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


## sendEmail

> sendEmail(applicationId, templateUUID, to, body, data, file)

Send an email

Send an email

### Example

```ts
import {
  Configuration,
  ClientApi,
} from '';
import type { SendEmailRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const config = new Configuration({ 
    // To configure API key authorization: auth0JWT
    apiKey: "YOUR API KEY",
  });
  const api = new ClientApi(config);

  const body = {
    // string | Application ID
    applicationId: applicationId_example,
    // string | TemplateUUID
    templateUUID: templateUUID_example,
    // string | To
    to: to_example,
    // string | Body (optional)
    body: body_example,
    // string | Data (optional)
    data: data_example,
    // Blob | File (optional)
    file: BINARY_DATA_HERE,
  } satisfies SendEmailRequest;

  try {
    const data = await api.sendEmail(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);
```

### Parameters


| Name | Type | Description  | Notes |
|------------- | ------------- | ------------- | -------------|
| **applicationId** | `string` | Application ID | [Defaults to `undefined`] |
| **templateUUID** | `string` | TemplateUUID | [Defaults to `undefined`] |
| **to** | `string` | To | [Defaults to `undefined`] |
| **body** | `string` | Body | [Optional] [Defaults to `undefined`] |
| **data** | `string` | Data | [Optional] [Defaults to `undefined`] |
| **file** | `Blob` | File | [Optional] [Defaults to `undefined`] |

### Return type

`void` (Empty response body)

### Authorization

[auth0JWT](../README.md#auth0JWT)

### HTTP request headers

- **Content-Type**: `multipart/form-data`
- **Accept**: `application/json`


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **202** | Email was sent |  -  |
| **400** | Return an error if there is a missing or invalid field |  -  |
| **401** | Return an error if the user is not authorized |  -  |
| **402** | Return an error if the trial access has expired |  -  |
| **403** | Return an error if the user does not have the required permissions |  -  |
| **404** | Return an error if the template is not found |  -  |
| **500** | Return an error if an internal error occurs |  -  |

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


## updateApplication

> ApplicationDTO updateApplication(applicationId, updateApplicationDTO)

Update an application

Update an application belonging to the authenticated account. Optionally accepts a smtpConfiguration object to create or update the SMTP configuration in the same request; when omitted or null the SMTP configuration is left untouched.

### Example

```ts
import {
  Configuration,
  ClientApi,
} from '';
import type { UpdateApplicationRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const config = new Configuration({ 
    // To configure API key authorization: auth0JWT
    apiKey: "YOUR API KEY",
  });
  const api = new ClientApi(config);

  const body = {
    // string | Application ID
    applicationId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
    // UpdateApplicationDTO | Application update data, it includes a SMTP configuration
    updateApplicationDTO: ...,
  } satisfies UpdateApplicationRequest;

  try {
    const data = await api.updateApplication(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);
```

### Parameters


| Name | Type | Description  | Notes |
|------------- | ------------- | ------------- | -------------|
| **applicationId** | `string` | Application ID | [Defaults to `undefined`] |
| **updateApplicationDTO** | [UpdateApplicationDTO](UpdateApplicationDTO.md) | Application update data, it includes a SMTP configuration | |

### Return type

[**ApplicationDTO**](ApplicationDTO.md)

### Authorization

[auth0JWT](../README.md#auth0JWT)

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | Updates an application and return an updated application if the ID exists |  -  |
| **400** | Return an error if provided ID is not a valid UUID |  -  |
| **401** | Return an error if the user is not authenticated |  -  |
| **402** | Return an error if the trial access has expired |  -  |
| **403** | Return an error if the user does not have the required permissions |  -  |
| **404** | Return an error if the application is not found |  -  |
| **500** | Return an error if the server founds an error |  -  |

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


## updateTemplate

> UpdateEmailTemplateDTO updateTemplate(applicationId, id, file, fromEmail, name, subject, toEmail)

Update a template

Update a template

### Example

```ts
import {
  Configuration,
  ClientApi,
} from '';
import type { UpdateTemplateRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const config = new Configuration({ 
    // To configure API key authorization: auth0JWT
    apiKey: "YOUR API KEY",
  });
  const api = new ClientApi(config);

  const body = {
    // string | Application ID
    applicationId: applicationId_example,
    // string | Template ID
    id: id_example,
    // Blob | file (optional)
    file: BINARY_DATA_HERE,
    // string | From Email (empty string clears the value) (optional)
    fromEmail: fromEmail_example,
    // string | Name (optional)
    name: name_example,
    // string | Subject (empty string clears the value) (optional)
    subject: subject_example,
    // string | To Email (empty string clears the value) (optional)
    toEmail: toEmail_example,
  } satisfies UpdateTemplateRequest;

  try {
    const data = await api.updateTemplate(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);
```

### Parameters


| Name | Type | Description  | Notes |
|------------- | ------------- | ------------- | -------------|
| **applicationId** | `string` | Application ID | [Defaults to `undefined`] |
| **id** | `string` | Template ID | [Defaults to `undefined`] |
| **file** | `Blob` | file | [Optional] [Defaults to `undefined`] |
| **fromEmail** | `string` | From Email (empty string clears the value) | [Optional] [Defaults to `undefined`] |
| **name** | `string` | Name | [Optional] [Defaults to `undefined`] |
| **subject** | `string` | Subject (empty string clears the value) | [Optional] [Defaults to `undefined`] |
| **toEmail** | `string` | To Email (empty string clears the value) | [Optional] [Defaults to `undefined`] |

### Return type

[**UpdateEmailTemplateDTO**](UpdateEmailTemplateDTO.md)

### Authorization

[auth0JWT](../README.md#auth0JWT)

### HTTP request headers

- **Content-Type**: `multipart/form-data`
- **Accept**: `application/json`


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | Template updated successfully |  -  |
| **400** | Return an error if input is invalid |  -  |
| **401** | Unauthorized |  -  |
| **402** | Return an error if the trial access has expired |  -  |
| **403** | Forbidden |  -  |
| **500** | Internal error |  -  |

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


## uploadTemplate

> EmailTemplateDTO uploadTemplate(applicationId, file, fromEmail, name, subject, toEmail)

Upload a template

Upload a template

### Example

```ts
import {
  Configuration,
  ClientApi,
} from '';
import type { UploadTemplateRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const config = new Configuration({ 
    // To configure API key authorization: auth0JWT
    apiKey: "YOUR API KEY",
  });
  const api = new ClientApi(config);

  const body = {
    // string | Application ID
    applicationId: applicationId_example,
    // Blob | file
    file: BINARY_DATA_HERE,
    // string | From Email
    fromEmail: fromEmail_example,
    // string | Name
    name: name_example,
    // string | Subject
    subject: subject_example,
    // string | To Email (optional)
    toEmail: toEmail_example,
  } satisfies UploadTemplateRequest;

  try {
    const data = await api.uploadTemplate(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);
```

### Parameters


| Name | Type | Description  | Notes |
|------------- | ------------- | ------------- | -------------|
| **applicationId** | `string` | Application ID | [Defaults to `undefined`] |
| **file** | `Blob` | file | [Defaults to `undefined`] |
| **fromEmail** | `string` | From Email | [Defaults to `undefined`] |
| **name** | `string` | Name | [Defaults to `undefined`] |
| **subject** | `string` | Subject | [Defaults to `undefined`] |
| **toEmail** | `string` | To Email | [Optional] [Defaults to `undefined`] |

### Return type

[**EmailTemplateDTO**](EmailTemplateDTO.md)

### Authorization

[auth0JWT](../README.md#auth0JWT)

### HTTP request headers

- **Content-Type**: `multipart/form-data`
- **Accept**: `application/json`


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **201** | Upload a template |  -  |
| **400** | Return an error if there is a missing or invalid field |  -  |
| **401** | Return an error if the user is not authorized |  -  |
| **402** | Return an error if the trial access has expired |  -  |
| **403** | Return an error if the user does not have the required permissions |  -  |
| **500** | Return an error if an internal error occurs |  -  |

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

