Content Types
The /types
endpoint allows you to manage your Content Types.
List Content Types
Endpoint: /types
Method: GET
Headers
Header | Value |
---|---|
Authorization | Bearer <YOUR_JWT_TOKEN> |
Query Parameters
Parameter | Data Type | Description |
---|---|---|
name | string | Optional name to filter by. |
chunckable | boolean | Optional flag to filter by whether the type is chunkable. |
layout | boolean | If true , the response will include the table layout for each type. |
limit | number | Optional maximum number of results to return. |
offset | number | Optional offset to start returning results from. |
Example Request
curl --location --request GET 'https://zeno-server-production.api.becomposable.com/api/v1/types?name=MyType&layout=true' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>'
Example Response
[
{
"id": "<OBJECT_ID>",
"name": "MyType",
"description": "My content type",
"table_layout": [
{
"field": "properties.title",
"name": "Title",
"type": "string"
},
{
"field": "properties.description",
"name": "Description",
"type": "string"
},
{
"field": "properties.author",
"name": "Author",
"type": "string"
}
],
"updated_by": "user:<USER_ID>",
"created_by": "user:<USER_ID>",
"created_at": "2023-09-25T14:17:56.411Z",
"updated_at": "2023-09-25T14:17:56.411Z"
}
]
Code Examples
List Content Types
curl --location --request GET 'https://zeno-server-production.api.becomposable.com/api/v1/types?name=MyType&layout=true' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>'
Retrieve a Content Type
Endpoint: /types/<TYPE_ID>
Method: GET
Headers
Header | Value |
---|---|
Authorization | Bearer <YOUR_JWT_TOKEN> |
Path Parameters
Parameter | Description |
---|---|
<TYPE_ID> | The ID of the content type to retrieve. |
Example Request
curl --location --request GET 'https://zeno-server-production.api.becomposable.com/api/v1/types/<TYPE_ID>' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>'
Example Response
{
"id": "<OBJECT_ID>",
"name": "MyType",
"description": "My content type",
"table_layout": [
{
"field": "properties.title",
"name": "Title",
"type": "string"
},
{
"field": "properties.description",
"name": "Description",
"type": "string"
},
{
"field": "properties.author",
"name": "Author",
"type": "string"
}
],
"object_schema": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"author": {
"type": "string"
}
},
"required": [
"title",
"description",
"author"
]
},
"updated_by": "user:<USER_ID>",
"created_by": "user:<USER_ID>",
"created_at": "2023-09-25T14:17:56.411Z",
"updated_at": "2023-09-25T14:17:56.411Z"
}
Code Examples
Retrieve a Content Type
curl --location --request GET 'https://zeno-server-production.api.becomposable.com/api/v1/types/<TYPE_ID>' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>'
Retrieve a Content Type by Name
Endpoint: /types/name/<TYPE_NAME>
Method: GET
Headers
Header | Value |
---|---|
Authorization | Bearer <YOUR_JWT_TOKEN> |
Path Parameters
Parameter | Description |
---|---|
<TYPE_NAME> | The name of the content type to retrieve. |
Example Request
curl --location --request GET 'https://zeno-server-production.api.becomposable.com/api/v1/types/name/<TYPE_NAME>' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>'
Example Response
{
"id": "<OBJECT_ID>",
"name": "MyType",
"description": "My content type",
"table_layout": [
{
"field": "properties.title",
"name": "Title",
"type": "string"
},
{
"field": "properties.description",
"name": "Description",
"type": "string"
},
{
"field": "properties.author",
"name": "Author",
"type": "string"
}
],
"object_schema": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"author": {
"type": "string"
}
},
"required": [
"title",
"description",
"author"
]
},
"updated_by": "user:<USER_ID>",
"created_by": "user:<USER_ID>",
"created_at": "2023-09-25T14:17:56.411Z",
"updated_at": "2023-09-25T14:17:56.411Z"
}
Code Examples
Retrieve a Content Type by Name
curl --location --request GET 'https://zeno-server-production.api.becomposable.com/api/v1/types/name/<TYPE_NAME>' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>'
Create a Content Type
Endpoint: /types
Method: POST
Headers
Header | Value |
---|---|
Authorization | Bearer <YOUR_JWT_TOKEN> |
Input Parameters
Parameter | Data Type | Description |
---|---|---|
name | string | The name of the content type. |
description | string | An optional description of the content type. |
is_chunkable | boolean | Whether the content type is chunkable. |
object_schema | JSONSchema4 | An optional JSON schema for the content type's properties. |
table_layout | ColumnLayout[] | An optional table layout for the content type's properties. |
Example Request
curl --location --request POST 'https://zeno-server-production.api.becomposable.com/api/v1/types' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "MyType",
"description": "My content type",
"is_chunkable": false,
"object_schema": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"author": {
"type": "string"
}
},
"required": [
"title",
"description",
"author"
]
},
"table_layout": [
{
"field": "properties.title",
"name": "Title",
"type": "string"
},
{
"field": "properties.description",
"name": "Description",
"type": "string"
},
{
"field": "properties.author",
"name": "Author",
"type": "string"
}
]
}'
Example Response
{
"id": "<OBJECT_ID>",
"name": "MyType",
"description": "My content type",
"table_layout": [
{
"field": "properties.title",
"name": "Title",
"type": "string"
},
{
"field": "properties.description",
"name": "Description",
"type": "string"
},
{
"field": "properties.author",
"name": "Author",
"type": "string"
}
],
"object_schema": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"author": {
"type": "string"
}
},
"required": [
"title",
"description",
"author"
]
},
"updated_by": "user:<USER_ID>",
"created_by": "user:<USER_ID>",
"created_at": "2023-09-25T14:17:56.411Z",
"updated_at": "2023-09-25T14:17:56.411Z"
}
Code Examples
Create a Content Type
curl --location --request POST 'https://zeno-server-production.api.becomposable.com/api/v1/types' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "MyType",
"description": "My content type",
"is_chunkable": false,
"object_schema": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"author": {
"type": "string"
}
},
"required": [
"title",
"description",
"author"
]
},
"table_layout": [
{
"field": "properties.title",
"name": "Title",
"type": "string"
},
{
"field": "properties.description",
"name": "Description",
"type": "string"
},
{
"field": "properties.author",
"name": "Author",
"type": "string"
}
]
}'
Update a Content Type
Endpoint: /types/<TYPE_ID>
Method: PUT
Headers
Header | Value |
---|---|
Authorization | Bearer <YOUR_JWT_TOKEN> |
Path Parameters
Parameter | Description |
---|---|
<TYPE_ID> | The ID of the content type to update. |
Input Parameters
Parameter | Data Type | Description |
---|---|---|
name | string | The name of the content type. |
description | string | An optional description of the content type. |
is_chunkable | boolean | Whether the content type is chunkable. |
object_schema | JSONSchema4 | An optional JSON schema for the content type's properties. |
table_layout | ColumnLayout[] | An optional table layout for the content type's properties. |
Example Request
curl --location --request PUT 'https://zeno-server-production.api.becomposable.com/api/v1/types/<TYPE_ID>' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "MyUpdatedType",
"description": "My updated content type"
}'
Example Response
{
"id": "<OBJECT_ID>",
"name": "MyUpdatedType",
"description": "My updated content type",
"table_layout": [
{
"field": "properties.title",
"name": "Title",
"type": "string"
},
{
"field": "properties.description",
"name": "Description",
"type": "string"
},
{
"field": "properties.author",
"name": "Author",
"type": "string"
}
],
"object_schema": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"author": {
"type": "string"
}
},
"required": [
"title",
"description",
"author"
]
},
"updated_by": "user:<USER_ID>",
"created_by": "user:<USER_ID>",
"created_at": "2023-09-25T14:17:56.411Z",
"updated_at": "2023-09-25T14:17:56.411Z"
}
Code Examples
Update a Content Type
curl --location --request PUT 'https://zeno-server-production.api.becomposable.com/api/v1/types/<TYPE_ID>' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "MyUpdatedType",
"description": "My updated content type"
}'
Delete a Content Type
Endpoint: /types/<TYPE_ID>
Method: DELETE
Headers
Header | Value |
---|---|
Authorization | Bearer <YOUR_JWT_TOKEN> |
Path Parameters
Parameter | Description |
---|---|
<TYPE_ID> | The ID of the content type to delete. |
Example Request
curl --location --request DELETE 'https://zeno-server-production.api.becomposable.com/api/v1/types/<TYPE_ID>' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>'
Example Response
{
"id": "<OBJECT_ID>"
}
Code Examples
Delete a Content Type
curl --location --request DELETE 'https://zeno-server-production.api.becomposable.com/api/v1/types/<TYPE_ID>' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>'
Find Content Types
Endpoint: /types/find
Method: POST
Headers
Header | Value |
---|---|
Authorization | Bearer <YOUR_JWT_TOKEN> |
Input Parameters
Parameter | Data Type | Description |
---|---|---|
query | Record<string, any> | The query to use to find content types. |
limit | number | Optional maximum number of results to return. |
select | string | Optional projection to apply to the results. |
Example Request
curl --location --request POST 'https://zeno-server-production.api.becomposable.com/api/v1/types/find' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"query": {
"name": "MyType"
},
"limit": 10,
"select": "name description"
}'
Example Response
[
{
"name": "MyType",
"description": "My content type"
}
]
Code Examples
Find Content Types
curl --location --request POST 'https://zeno-server-production.api.becomposable.com/api/v1/types/find' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"query": {
"name": "MyType"
},
"limit": 10,
"select": "name description"
}'