Create custom field
POST
/space/custom_field
const url = 'https://api.aelyst.ai/v1/space/custom_field';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"notes","description":"The internal notes about this customer","dataType":"text"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.aelyst.ai/v1/space/custom_field \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "notes", "description": "The internal notes about this customer", "dataType": "text" }'Create a new custom field
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Media typeapplication/json
object
name
required
string
slug
The unique identifier for API and integrations. Field ID cannot be edited once added. Only letters, numbers, and underscores are allowed for this field.
string
description
string
dataType
required
string
allowedValues
Only to be provided when the value of dataType is list
Array<string>
Examples
{ "name": "notes", "description": "The internal notes about this customer", "dataType": "text"}{ "name": "Fruits", "description": "The type of fruits we have", "dataType": "list", "allowedValues": [ "Apple", "Banana", "Mango" ]}{ "name": "Order Number", "description": "The order number of customer", "dataType": "number"}{ "name": "New Customer", "description": "A flag to see if its a new customer.", "dataType": "checkbox"}Responses
Section titled “Responses”Media typeapplication/json
object
id
required
Custom field ID.
integer
name
required
Name of the custom field.
string
description
required
string
dataType
required
Type of the data stored in this custom field.
string
allowedValues
List of enum values allowed to be stored in this field. This property is applicable only if the dataType is list.
Array<string>
Example
{ "id": 123, "name": "customer_id", "description": "Customer ID", "dataType": "text"}Media typeapplication/json
object
code
integer
message
string
Example
{ "code": 400, "message": "Validation error."}Media typeapplication/json
object
code
integer
message
string
Example
{ "code": 401, "message": "UN_AUTHORIZED"}Media typeapplication/json
object
code
integer
message
string
Example
{ "code": 429, "message": "Too Many Requests"}Headers
Section titled “Headers”Retry-After
number
Example
1Number of seconds until you can retry the request
X-RateLimit-Limit
number
Example
10Number of request allowed for this end point
X-RateLimit-Remaining
number
Example
5Number of request remaining for this end point
Media typeapplication/json
object
code
integer
message
string
Example
{ "code": 500, "message": "Unexpected error occurred"}