This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Creates a new data collection.
Details of the collection to create.
Details of the created collection.
curl POST https://external-db.example.com/v3/collections/create \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'Authorization: <AUTH>' \
--d '{
"collection": {
"id": "cities",
"displayName": "Cities",
"fields": [{
"key": "name",
"displayName": "Name",
"description": "The name of the city",
"type": "TEXT",
"encrypted": false
}, {
"key": "country",
"displayName": "Country",
"description": "Country code",
"type": "TEXT",
"encrypted": false
}, {
"key": "pointsOfInterest",
"displayName": "Points of interest",
"type": "MULTI_REFERENCE",
"multiReferenceOptions": {
"referencedCollectionId": "pointsOfInterest",
"referencedCollectionFieldKey": "cities",
"referencedCollectionFieldDisplayName": "Cities"
},
"encrypted": false
}, {
"key": "_id",
"displayName": "ID",
"type": "TEXT",
"encrypted": false
}, {
"key": "_createdDate",
"displayName": "Created Date",
"type": "DATETIME",
"encrypted": false
}, {
"key": "_updatedDate",
"displayName": "Updated Date",
"type": "DATETIME",
"encrypted": false
}, {
"key": "_owner",
"displayName": "Owner",
"type": "TEXT",
"encrypted": false
}],
"permissions": {
"insert": "ADMIN",
"update": "ADMIN",
"remove": "ADMIN",
"read": "ANYONE"
},
"pagingMode": "UNKNOWN_PAGING_MODE"
}
}'
{
"collection": {
"id": "cities",
"displayName": "Cities",
"fields": [
{
"key": "_id",
"displayName": "ID",
"description": "The ID of the document",
"type": "TEXT",
"capabilities": {
"sortable": true,
"queryOperators": ["EQ", "LT", "GT", "LTE", "GTE"]
},
"encrypted": false
},
{
"key": "name",
"displayName": "Name",
"description": "The name of the city",
"type": "TEXT",
"capabilities": {
"sortable": true,
"queryOperators": ["EQ", "STARTS_WITH"]
},
"encrypted": false
},
{
"key": "country",
"displayName": "Country",
"description": "Country code",
"type": "TEXT",
"capabilities": {
"sortable": true,
"queryOperators": ["EQ"]
},
"encrypted": false
},
{
"key": "pointsOfInterest",
"displayName": "Points of interest",
"type": "MULTI_REFERENCE",
"multiReferenceOptions": {
"referencedCollectionId": "pointsOfInterest"
},
"encrypted": false
},
{
"key": "_createdDate",
"displayName": "Created date",
"description": "The date when the document was created",
"type": "DATETIME",
"capabilities": {
"sortable": false,
"queryOperators": []
},
"encrypted": false
},
{
"key": "_updatedDate",
"displayName": "Updated date",
"description": "The date when the document was last updated",
"type": "DATETIME",
"capabilities": {
"sortable": false,
"queryOperators": []
},
"encrypted": false
},
{
"key": "_owner",
"type": "TEXT",
"capabilities": {
"sortable": false,
"queryOperators": []
},
"encrypted": false
}
],
"capabilities": {
"dataOperations": ["QUERY", "COUNT"]
},
"permissions": {
"insert": "ADMIN",
"update": "ADMIN",
"remove": "ADMIN",
"read": "ANYONE"
},
"pagingMode": "OFFSET"
}
}