All URIs are relative to https://api.sendx.io/api/v1/rest
| Method | HTTP request | Description |
|---|---|---|
| createCustomField | POST /customfield | Create custom field |
| deleteCustomField | DELETE /customfield/{identifier} | Delete custom field |
| getAllCustomFields | GET /customfield | Get all custom fields |
| getCustomField | GET /customfield/{identifier} | Get custom field by ID |
| updateCustomField | PUT /customfield/{identifier} | Update custom field |
RestRCustomField createCustomField(restECustomField)
Create custom field
Creates a new custom field for storing contact data.
import sendx from 'sendx-javascript-sdk';
let defaultClient = sendx.ApiClient.instance;
// Configure API key authorization: TeamApiKey
let TeamApiKey = defaultClient.authentications['TeamApiKey'];
TeamApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TeamApiKey.apiKeyPrefix = 'Token';
let apiInstance = new sendx.CustomFieldApi();
let restECustomField = new sendx.RestECustomField(); // RestECustomField |
apiInstance.createCustomField(restECustomField).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});| Name | Type | Description | Notes |
|---|---|---|---|
| restECustomField | RestECustomField |
- Content-Type: application/json
- Accept: application/json
DeleteResponse deleteCustomField(identifier)
Delete custom field
Deletes a custom field (data is preserved). 🎯 Key Features: - Remove unused fields - Data remains on contacts - Clean up field list
import sendx from 'sendx-javascript-sdk';
let defaultClient = sendx.ApiClient.instance;
// Configure API key authorization: TeamApiKey
let TeamApiKey = defaultClient.authentications['TeamApiKey'];
TeamApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TeamApiKey.apiKeyPrefix = 'Token';
let apiInstance = new sendx.CustomFieldApi();
let identifier = "identifier_example"; // String | Custom field identifier to update
apiInstance.deleteCustomField(identifier).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});| Name | Type | Description | Notes |
|---|---|---|---|
| identifier | String | Custom field identifier to update |
- Content-Type: Not defined
- Accept: application/json
[RestRCustomField] getAllCustomFields(opts)
Get all custom fields
Retrieves all custom fields defined for your team.
import sendx from 'sendx-javascript-sdk';
let defaultClient = sendx.ApiClient.instance;
// Configure API key authorization: TeamApiKey
let TeamApiKey = defaultClient.authentications['TeamApiKey'];
TeamApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TeamApiKey.apiKeyPrefix = 'Token';
let apiInstance = new sendx.CustomFieldApi();
let opts = {
'offset': 0, // Number | Number of fields to skip for pagination
'limit': 10, // Number | Maximum number of fields to return
'search': "search_example" // String | Search custom fields by name (case-insensitive partial matching). **Examples:** - `points` - Finds \"Loyalty points\", \"Reward points\"
};
apiInstance.getAllCustomFields(opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});| Name | Type | Description | Notes |
|---|---|---|---|
| offset | Number | Number of fields to skip for pagination | [optional] [default to 0] |
| limit | Number | Maximum number of fields to return | [optional] [default to 10] |
| search | String | Search custom fields by name (case-insensitive partial matching). Examples: - `points` - Finds "Loyalty points", "Reward points" | [optional] |
- Content-Type: Not defined
- Accept: application/json
RestRCustomField getCustomField(identifier)
Get custom field by ID
Retrieves details about a specific custom field.
import sendx from 'sendx-javascript-sdk';
let defaultClient = sendx.ApiClient.instance;
// Configure API key authorization: TeamApiKey
let TeamApiKey = defaultClient.authentications['TeamApiKey'];
TeamApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TeamApiKey.apiKeyPrefix = 'Token';
let apiInstance = new sendx.CustomFieldApi();
let identifier = "identifier_example"; // String | Custom field identifier to update
apiInstance.getCustomField(identifier).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});| Name | Type | Description | Notes |
|---|---|---|---|
| identifier | String | Custom field identifier to update |
- Content-Type: Not defined
- Accept: application/json
RestRCustomField updateCustomField(restECustomField, identifier)
Update custom field
Updates a custom field definition.
import sendx from 'sendx-javascript-sdk';
let defaultClient = sendx.ApiClient.instance;
// Configure API key authorization: TeamApiKey
let TeamApiKey = defaultClient.authentications['TeamApiKey'];
TeamApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TeamApiKey.apiKeyPrefix = 'Token';
let apiInstance = new sendx.CustomFieldApi();
let restECustomField = {"name":"Customer Tier","description":"Customer segmentation tier (Bronze/Silver/Gold)"}; // RestECustomField |
let identifier = "identifier_example"; // String | Custom field identifier to update
apiInstance.updateCustomField(restECustomField, identifier).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});| Name | Type | Description | Notes |
|---|---|---|---|
| restECustomField | RestECustomField | ||
| identifier | String | Custom field identifier to update |
- Content-Type: application/json
- Accept: application/json