update a Field
- Raw
- cURL
- Python
- Javascript / fetch
PUT /fields/:id
PUT /fields/tbl_RSe4wbfuHSXelT8rNrMOJSAE HTTP/1.1
Authorization: Bearer <YOUR_API_TOKEN>
Host: api.lytecms.com
{
"name": "New Name"
}
PUT /fields/:id
curl -X PUT /fields/tbl_RSe4wbfuHSXelT8rNrMOJSAE
-H "Authorization: Bearer <YOUR_API_TOKEN>"
-H "Host: api.lytecms.com"
-d '{
"name": "New Name"
}'
PUT /fields/:id
import requests
payload = {
"name": "New Name"
}
r = requests.request(
method="PUT",
url="/fields/tbl_RSe4wbfuHSXelT8rNrMOJSAE",
headers={
"Authorization": "Bearer <YOUR_API_TOKEN>",
"Host": "api.lytecms.com"
},
json=payload,
)
PUT /fields/:id
fetch("/fields/tbl_RSe4wbfuHSXelT8rNrMOJSAE", {
method: "PUT",
headers: {
"Authorization": "Bearer <YOUR_API_TOKEN>",
"Host": "api.lytecms.com",
},
body: JSON.stringify({
"name": "New Name"
}),
}).then((response) => console.log(response.json()))
Parameters
{
"name": "Status",
"type": "checkbox"
}
Parameter | Type | Required | Description |
---|---|---|---|
name | string | Yes | name of the field |
type | string | Yes | type of the field |
options | array of the option object | No | options of the field, only for singleSelect and multipleSelects field |
The option
object
Example:
{
"color": "red1",
"text": "Option 1"
}
Defination:
Parameter | Type | Required | Description |
---|---|---|---|
text | string | Yes | text of the option |
color | string | Yes | color of the option |
The color should be one of:
- gray1
- gray2
- gray3
- red1
- red2
- red3
- orange1
- orange2
- orange3
- yellow1
- yellow2
- yellow3
- green1
- green2
- green3
- cyan1
- cyan2
- cyan3
- blue1
- blue2
- blue3
- violet1
- violet2
- violet3
- fuchsia1
- fuchsia2
- fuchsia3
- pink1
- pink2
- pink3
Response
{
"id": "fld_6lUmhjszoQzO6I8IGRtG8QWR",
"name": "Status",
"type": "checkbox",
"options": null,
"create_time": 1704786716,
"update_time": 1704786716
}