Create a Field
- Raw
- cURL
- Python
- Javascript / fetch
POST /fields
POST /projects HTTP/1.1
Authorization: Bearer <YOUR_API_TOKEN>
Host: api.lytecms.com
{"name": "My Project"}
POST /fields
curl -X POST /projects
-H "Authorization: Bearer <YOUR_API_TOKEN>"
-H "Host: api.lytecms.com"
-d '{"name": "My Project"}'
POST /fields
import requests
payload = {"name": "My Project"}
r = requests.request(
method="POST",
url="/projects",
headers={
"Authorization": "Bearer <YOUR_API_TOKEN>",
"Host": "api.lytecms.com"
},
json=payload,
)
POST /fields
fetch("/projects", {
method: "POST",
headers: {
"Authorization": "Bearer <YOUR_API_TOKEN>",
"Host": "api.lytecms.com",
},
body: JSON.stringify({"name": "My Project"}),
}).then((response) => console.log(response.json()))
Parameters
{
"table": "tbl_U3qFJJ5rbGA38xDeLjD3jrU3",
"name": "Text Field",
"type": "text"
}
Parameter | Type | Required | Description |
---|---|---|---|
table | string | Yes | ID of the table |
name | string | Yes | Name of the field |
type | string | Yes | Type of the field |
The type
field can be one of the following:
text
article
number
singleSelect
multipleSelects
checkbox
image
links
- 🚧 (WIP)
rating
- 🚧 (WIP)
slug
- 🚧 (WIP)
datetime
- 🚧 (WIP)
created_time
- 🚧 (WIP)
updated_time
Response
{
"id": "fld_SccxzCIFSyLeD4RVpennsQLr",
"name": "test table",
"type": "text",
"create_time": 1707029392,
"update_time": 1707029392
}