Define a custom field
POST
/products/{productId}/custom-fields
const url = 'https://api.motenya.app/v1/products/example/custom-fields';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"entity":"contact","key":"example","label":"example","type":"text","options":[{"key":"example","label":"example","archived":true}],"required":true,"filterable":true,"onCard":true}'};
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.motenya.app/v1/products/example/custom-fields \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "entity": "contact", "key": "example", "label": "example", "type": "text", "options": [ { "key": "example", "label": "example", "archived": true } ], "required": true, "filterable": true, "onCard": true }'Requires crm:configure.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”productId
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
entity
required
string
key
required
Stable key used in custom objects.
string
label
required
string
type
required
string
options
For select and multiselect.
Array<object> | null
object
key
Omit for a new option: derived from the label.
string | null
label
required
string
archived
boolean | null
required
boolean | null
filterable
boolean | null
onCard
boolean | null
Responses
Section titled “Responses”Success
Media typeapplication/json
object
id
required
string
entity
required
string
key
required
string
label
required
string
type
required
string
options
required
Array<object>
object
key
required
string
label
required
string
archived
required
boolean
required
required
boolean
filterable
required
boolean
onCard
required
boolean
position
required
integer
archived
required
boolean
createdAt
required
string
updatedAt
required
string
key
additional properties
Example
{ "entity": "contact", "type": "text"}Invalid request
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string
Example
{ "error": { "code": "SLUG_TAKEN" }}Missing, invalid, revoked or expired API key
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string
Example
{ "error": { "code": "SLUG_TAKEN" }}Missing scope, API turned off, published article without publish scope, or account suspended
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string
Example
{ "error": { "code": "SLUG_TAKEN" }}Not found, or outside the knowledge bases this key may use
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string
Example
{ "error": { "code": "SLUG_TAKEN" }}Slug or translation already exists
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string
Example
{ "error": { "code": "SLUG_TAKEN" }}Rejected by validation (e.g. unknown language or category)
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string
Example
{ "error": { "code": "SLUG_TAKEN" }}Rate limited; see Retry-After
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string
Example
{ "error": { "code": "SLUG_TAKEN" }}Internal error