Skip to content

Create new field

To create a new field, specify both title and field type.

HTTP method: POST

https://api.sender.net/v2/fields


ParameterTypeDescription
titlestring requiredName of the new field
typestring requiredThe value must be one of the following: “number”, “text”, or “datetime”.

const url = new URL("https://api.sender.net/v2/fields");
let headers = {
"Authorization": "Bearer [your-token]",
"Content-Type": "application/json",
"Accept": "application/json",
};
let bodyContent = {
"title": "New text field",
"type": "text"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(bodyContent)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));

Example Response
{
"success": true,
"message": "Field successfully created",
"data": {
"id": "epxZye",
"title": "New text field",
"account_id": "eEqqve",
"user_id": "egp79a",
"created": "2022-06-02 10:12:25",
"modified": "2022-06-02 10:12:25",
"type": "text",
"show": 0,
"field_name": "{$new_text_field}",
"position": 0,
"default": false
}
}