Authenticates user by API key. API key must be sent in Bearer authorization header. Returns array of objects containing JWT tokens for accessing databases where user exists. Use this token (in Bearer authorization header) for /account, /entity and /property requests.
GET /api/auth HTTP/1.1
Host: entu.app
Accept-Encoding: deflate
Authorization: Bearer nEkPYET5fYjJqktNz9yfLxPF
{
"accounts": [
{
"_id": "account1",
"name": "account1",
"user": {
"_id": "npfwb8fv4ku7tzpq5yjarncc",
"name": "User 1"
}
},
{
"_id": "account2",
"name": "account2",
"user": {
"_id": "sgkjlrq2evnmc3awmgnhfbb9",
"name": "User 2"
}
}
],
"token": "hNGcQgaeKh7ptWF5FVPbfKgpR5ZHCzT5cbA4BQWtmWGkfdQHg5HLDMCB8GwKw8gG"
}
Redirects user to OAuth.ee for authentication. After successful authentication:
Use this temporary API key to get JWT tokens from /auth. This key can be used only once.
{
"key": "M2s8xKpwxG77JYxbx7xw4cS9"
}
Returns account info and usage statistics
GET /api/account1 HTTP/1.1
Host: entu.app
Accept-Encoding: deflate
Authorization: Bearer c3H8gHLk9hjf6323n8dPHzXb
{
"entities": 531,
"deletedEntities": 85,
"properties": 7446,
"deletedProperties": 1547,
"files": 70,
"filesSize": 16240263,
"deletedFiles": 9,
"deletedFilesSize": 1392158
}
Get list of entities.
To filter entities by property value. Use dot separated list of property key, data type and operator as query parameter(s). Operator is optional, but must be one of following:
GET /api/account1/entity?forename.string=John&file.size.gte=1024&surname.string.regex=/^Apple/i&photo._id.exists=false&sort=-file.size&limit=12 HTTP/1.1
Host: entu.app
Accept-Encoding: deflate
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
{
"count": 0,
"entities": []
}
Create new entity. Data must be sent as JSON list containing property object(s).
Returns created entity _id and added properties.
For file upload, add filename, filesize and filetype to property parameters. Response contains upload object with info (url, method and headers) where to upload file (as request body).
POST /api/account1/entity HTTP/1.1
Host: entu.app
Accept-Encoding: deflate
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
Content-Type: application/json; charset=utf-8
Content-Length: 151
[
{ "type": "_type", "string": "book" },
{ "type": "title", "string": "Hobbit" },
{ "type": "photo", "filename": "cover.jpg", "filesize": 1937, "filetype": "image/jpeg" }
]
{
"_id": "bsskJkDWwQXHB8ut7vQvmWZ4",
"properties": [
{
"_id": "92eVbRk2xx44n2gXsxXaxQcd",
"type": "_type",
"string": "book"
},
{
"_id": "92eVbRk2xxFun2gXsxXaxWFk",
"type": "title",
"string": "Hobbit"
},
{
"_id": "qXNdbysby2NHcgVDK3rrXUZk",
"type": "photo",
"filename": "cover.jpg",
"filesize": 1937,
"upload": {
"url": "https://entu-files.s3-eu-west-1.amazonaws.com/entu/qXNdbysby2NHcgVDK3rrXUZk?",
"method": "PUT",
"headers": {}
}
}
]
}
Get one entity with given id.
GET /api/account1/entity/59abac1bb5684200016be61e HTTP/1.1
Host: entu.app
Accept-Encoding: deflate
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
{}
Add new properties to existing entity. Data must be sent as JSON list containing property object(s).
Returns added properties.
For file upload, add filename, filesize and filetype to property parameters. Response contains upload object with info (url, method and headers) where to upload file (as request body).
POST /api/account1/entity/hAazguCezHwDfLe2geyKKpqj HTTP/1.1
Host: entu.app
Accept-Encoding: deflate
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
Content-Type: application/json; charset=utf-8
Content-Length: 164
[
{ "_id": "65bcf278e0ef82d4b91f40d7", "type": "title", "string": "Hobbit", "language": "EN" },
{ "type": "photo", "filename": "cover.jpg", "filesize": 1937 }
]
{
"_id": "bsskJkDWwQXHB8ut7vQvmWZ4",
"properties": [
{
"_id": "92eVbRk2xxFun2gXsxXaxWFk",
"type": "title",
"string": "Hobbit"
},
{
"_id": "qXNdbysby2NHcgVDK3rrXUZk",
"type": "photo",
"filename": "cover.jpg",
"filesize": 1937,
"upload": {
"url": "https://entu-files.s3-eu-west-1.amazonaws.com/entu/qXNdbysby2NHcgVDK3rrXUZk?",
"method": "PUT",
"headers": {}
}
}
]
}
Delete entity with given id.
DELETE /api/account1/entity/59abac1bb5684200016be61e HTTP/1.1
Host: entu.app
Accept-Encoding: deflate
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
{
"deleted": true
}
Get entity history (changelog).
GET /api/account1/entity/59abac1bb5684200016be61e/history HTTP/1.1
Host: entu.app
Accept-Encoding: deflate
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
{}
Get property with given id.
GET /api/account1/property/5b9648dd2e5c91011f9a42b5 HTTP/1.1
Host: entu.app
Accept-Encoding: deflate
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
{}
Delete property with given id.
DELETE /api/account1/property/5b9648dd2e5c9100459a4157 HTTP/1.1
Host: entu.app
Accept-Encoding: deflate
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
{
"deleted": true
}
Entu system properties begin with _. Those properties are: