Define a field
POST
/api/v1/fields
const url = 'http://localhost:3000/api/v1/fields';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"key":"example","label":"example","type":"text","options":[],"required":false,"position":0}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:3000/api/v1/fields \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "key": "example", "label": "example", "type": "text", "options": [], "required": false, "position": 0 }'Scope: write.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
key
required
string
label
required
string
type
required
string
options
Array<string>
required
boolean
position
integer
Responses
Section titled “Responses”Created
Media typeapplication/json
object
data
required
object
key
required
string
label
required
string
type
required
string
options
required
Array<string>
required
required
boolean
Example
{ "data": { "type": "text" }}default
Section titled “default”An error
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
detail
Examplegenerated
{ "error": { "code": "example", "message": "example", "detail": "example" }}