Posts
The Posts API supports managing posts.
Create post
Creates a new post in the specified posts app.
POST /api/apps/{app}/posts
Path parameters
appstringrequiredApp identifier (
idoruid)
Body parameters
blobsarray of integersIds of blobs to attach.
embed_idintegerId of embed to attach.
meeting_idintegerId of meeting to attach.
optionsarray of objectsList of poll options to attach.
textstringThe message text.
metadataobjectAdditional metadata properties, e.g.
{ "color": "blue", "size": "XL" }.
tagsarray of stringsA list of tags to associate with the item.
Example request
curl {WEAVY-URL}/api/apps/acme-posts/posts
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
--json "{ 'text': 'This is a post' }"
Response codes
201 Created
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
422 Validation Failed
Response schema
{
"id": "integer",
"app": {
"id": "integer",
"rev": "integer",
"type": "string",
"uid": "string",
"name": "string",
"description": "string",
"archive_url": "string",
"avatar_url": "string",
"metadata": "object",
"tags": [
"string"
],
"access": "string",
"directory_id": "integer",
"created_at": "string",
"updated_at": "string",
"is_pinned": "boolean",
"is_starred": "boolean",
"is_subscribed": "boolean",
"is_trashed": "boolean",
"is_unread": "boolean",
"permissions": [
"string"
]
},
"parent": {
"id": "integer",
"type": "string"
},
"text": "string",
"html": "string",
"plain": "string",
"embed": {
"id": "integer",
"type": "string",
"title": "string",
"description": "string",
"url": "string",
"thumbnail_url": "string",
"actions": [
"string"
],
"metadata": "object",
"author_name": "string",
"author_url": "string",
"provider_name": "string",
"provider_url": "string",
"html": "string",
"width": "integer",
"height": "integer"
},
"meeting": {
"id": "integer",
"provider": "string",
"provider_id": "string",
"join_url": "string",
"code": "string",
"created_at": "string",
"metadata": "object"
},
"annotations": {
"data": [
"object"
],
"start": "integer",
"end": "integer",
"count": "integer"
},
"attachments": {
"data": [
"object"
],
"start": "integer",
"end": "integer",
"count": "integer"
},
"comments": {
"data": [
"object"
],
"start": "integer",
"end": "integer",
"count": "integer"
},
"options": {
"data": [
"object"
],
"start": "integer",
"end": "integer",
"count": "integer"
},
"reactions": {
"data": [
"object"
],
"start": "integer",
"end": "integer",
"count": "integer"
},
"metadata": "object",
"tags": [
"string"
],
"is_starred": "boolean",
"is_subscribed": "boolean",
"is_trashed": "boolean",
"created_at": "string",
"created_by": {
"id": "integer",
"uid": "string",
"name": "string",
"given_name": "string",
"middle_name": "string",
"family_name": "string",
"nickname": "string",
"email": "string",
"phone_number": "string",
"username": "string",
"avatar_url": "string",
"presence": "string",
"comment": "string",
"metadata": "object",
"tags": [
"string"
],
"created_at": "string",
"updated_at": "string",
"is_followed": "boolean",
"is_trashed": "boolean"
},
"updated_at": "string",
"updated_by": {
"id": "integer",
"uid": "string",
"name": "string",
"given_name": "string",
"middle_name": "string",
"family_name": "string",
"nickname": "string",
"email": "string",
"phone_number": "string",
"username": "string",
"avatar_url": "string",
"presence": "string",
"comment": "string",
"metadata": "object",
"tags": [
"string"
],
"created_at": "string",
"updated_at": "string",
"is_followed": "boolean",
"is_trashed": "boolean"
}
}
Get post
Gets a post by id.
GET /api/posts/{id}
Path parameters
idintegerrequiredId of the post.
Query parameters
trashedbooleantrueto return post even if trashed.
Example request
curl {WEAVY-URL}/api/posts/1
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Response codes
200 OK
401 Unauthorized
404 Not Found
Response schema
{
"id": "integer",
"app": {
"id": "integer",
"rev": "integer",
"type": "string",
"uid": "string",
"name": "string",
"description": "string",
"archive_url": "string",
"avatar_url": "string",
"metadata": "object",
"tags": [
"string"
],
"access": "string",
"directory_id": "integer",
"created_at": "string",
"updated_at": "string",
"is_pinned": "boolean",
"is_starred": "boolean",
"is_subscribed": "boolean",
"is_trashed": "boolean",
"is_unread": "boolean",
"permissions": [
"string"
]
},
"parent": {
"id": "integer",
"type": "string"
},
"text": "string",
"html": "string",
"plain": "string",
"embed": {
"id": "integer",
"type": "string",
"title": "string",
"description": "string",
"url": "string",
"thumbnail_url": "string",
"actions": [
"string"
],
"metadata": "object",
"author_name": "string",
"author_url": "string",
"provider_name": "string",
"provider_url": "string",
"html": "string",
"width": "integer",
"height": "integer"
},
"meeting": {
"id": "integer",
"provider": "string",
"provider_id": "string",
"join_url": "string",
"code": "string",
"created_at": "string",
"metadata": "object"
},
"annotations": {
"data": [
"object"
],
"start": "integer",
"end": "integer",
"count": "integer"
},
"attachments": {
"data": [
"object"
],
"start": "integer",
"end": "integer",
"count": "integer"
},
"comments": {
"data": [
"object"
],
"start": "integer",
"end": "integer",
"count": "integer"
},
"options": {
"data": [
"object"
],
"start": "integer",
"end": "integer",
"count": "integer"
},
"reactions": {
"data": [
"object"
],
"start": "integer",
"end": "integer",
"count": "integer"
},
"metadata": "object",
"tags": [
"string"
],
"is_starred": "boolean",
"is_subscribed": "boolean",
"is_trashed": "boolean",
"created_at": "string",
"created_by": {
"id": "integer",
"uid": "string",
"name": "string",
"given_name": "string",
"middle_name": "string",
"family_name": "string",
"nickname": "string",
"email": "string",
"phone_number": "string",
"username": "string",
"avatar_url": "string",
"presence": "string",
"comment": "string",
"metadata": "object",
"tags": [
"string"
],
"created_at": "string",
"updated_at": "string",
"is_followed": "boolean",
"is_trashed": "boolean"
},
"updated_at": "string",
"updated_by": {
"id": "integer",
"uid": "string",
"name": "string",
"given_name": "string",
"middle_name": "string",
"family_name": "string",
"nickname": "string",
"email": "string",
"phone_number": "string",
"username": "string",
"avatar_url": "string",
"presence": "string",
"comment": "string",
"metadata": "object",
"tags": [
"string"
],
"created_at": "string",
"updated_at": "string",
"is_followed": "boolean",
"is_trashed": "boolean"
}
}
Update post
Updates a post.
PATCH /api/posts/{id}
Path parameters
idintegerrequiredId of the post.
Body parameters
attachmentsarray of integersIds of attached files.
blobsarray of integersIds of additional blobs to attach.
embed_idintegerId of embed to attach.
meeting_idintegerId of meeting to attach.
optionsarray of objectsList of poll options for the item.
textstringThe message text.
metadataobjectAdditional metadata properties, e.g.
{ "color": "blue", "size": "XL" }.
tagsarray of stringsA list of tags to associate with the item.
Example request
curl -X PATCH {WEAVY-URL}/api/posts/1
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
--json "{ 'text': 'This is an updated post' }"
Response codes
200 OK
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
422 Validation Failed
Response schema
{
"id": "integer",
"app": {
"id": "integer",
"rev": "integer",
"type": "string",
"uid": "string",
"name": "string",
"description": "string",
"archive_url": "string",
"avatar_url": "string",
"metadata": "object",
"tags": [
"string"
],
"access": "string",
"directory_id": "integer",
"created_at": "string",
"updated_at": "string",
"is_pinned": "boolean",
"is_starred": "boolean",
"is_subscribed": "boolean",
"is_trashed": "boolean",
"is_unread": "boolean",
"permissions": [
"string"
]
},
"parent": {
"id": "integer",
"type": "string"
},
"text": "string",
"html": "string",
"plain": "string",
"embed": {
"id": "integer",
"type": "string",
"title": "string",
"description": "string",
"url": "string",
"thumbnail_url": "string",
"actions": [
"string"
],
"metadata": "object",
"author_name": "string",
"author_url": "string",
"provider_name": "string",
"provider_url": "string",
"html": "string",
"width": "integer",
"height": "integer"
},
"meeting": {
"id": "integer",
"provider": "string",
"provider_id": "string",
"join_url": "string",
"code": "string",
"created_at": "string",
"metadata": "object"
},
"annotations": {
"data": [
"object"
],
"start": "integer",
"end": "integer",
"count": "integer"
},
"attachments": {
"data": [
"object"
],
"start": "integer",
"end": "integer",
"count": "integer"
},
"comments": {
"data": [
"object"
],
"start": "integer",
"end": "integer",
"count": "integer"
},
"options": {
"data": [
"object"
],
"start": "integer",
"end": "integer",
"count": "integer"
},
"reactions": {
"data": [
"object"
],
"start": "integer",
"end": "integer",
"count": "integer"
},
"metadata": "object",
"tags": [
"string"
],
"is_starred": "boolean",
"is_subscribed": "boolean",
"is_trashed": "boolean",
"created_at": "string",
"created_by": {
"id": "integer",
"uid": "string",
"name": "string",
"given_name": "string",
"middle_name": "string",
"family_name": "string",
"nickname": "string",
"email": "string",
"phone_number": "string",
"username": "string",
"avatar_url": "string",
"presence": "string",
"comment": "string",
"metadata": "object",
"tags": [
"string"
],
"created_at": "string",
"updated_at": "string",
"is_followed": "boolean",
"is_trashed": "boolean"
},
"updated_at": "string",
"updated_by": {
"id": "integer",
"uid": "string",
"name": "string",
"given_name": "string",
"middle_name": "string",
"family_name": "string",
"nickname": "string",
"email": "string",
"phone_number": "string",
"username": "string",
"avatar_url": "string",
"presence": "string",
"comment": "string",
"metadata": "object",
"tags": [
"string"
],
"created_at": "string",
"updated_at": "string",
"is_followed": "boolean",
"is_trashed": "boolean"
}
}
List posts
List posts.
GET /api/posts
Query parameters
apparray of stringsOne or more app identifiers (
idoruid). Used to find posts in specific apps.
beforeintegerUsed to find posts with ids less then than a specific post id.
afterintegerUsed to find posts with ids greater than a specific post id.
aroundintegerA post id. Used to find results "around" a specific post.
followingbooleanWhen
true, returns posts by users the authenticated user is following.
outstringOverrides the default output format. Possible values are
summaryanddetails.
qstringA string used to find matching items by name, e.g.
q=test.
tagstringList items with the specified tag.
trashedbooleanIndicates whether trashed items should be listed (default is
false). Specifynullto list both trashed and non-trashed items.
order_bystringSpecifies the sort order and direction for the listing, e.g.
order_by=idororder_by=id+desc.
skipintegerThe number of items to skip. Used together with
taketo return a specific range of items (for pagination).
takeintegerMaximum number of items to return in the listing. Should be a value between
1and100. Default is25.
count_onlybooleantrueto count the number of matching items instead of listing them; when specified the response will only contain thecountproperty.
Example request
curl {WEAVY-URL}/api/posts
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Response codes
200 OK
401 Unauthorized
Response schema
{
"data": [
{
"id": "integer",
"text": "string",
"html": "string",
"plain": "string",
"metadata": "object",
"tags": [
"string"
],
"is_starred": "boolean",
"is_subscribed": "boolean",
"is_trashed": "boolean",
"created_at": "string",
"updated_at": "string"
}
],
"start": "integer",
"end": "integer",
"count": "integer"
}
List app posts
List posts in the specified posts app.
GET /api/apps/{app}/posts
Path parameters
appstringrequiredApp identifier (
idoruid)
Query parameters
apparray of stringsOne or more app identifiers (
idoruid). Used to find posts in specific apps.
beforeintegerUsed to find posts with ids less then than a specific post id.
afterintegerUsed to find posts with ids greater than a specific post id.
aroundintegerA post id. Used to find results "around" a specific post.
followingbooleanWhen
true, returns posts by users the authenticated user is following.
outstringOverrides the default output format. Possible values are
summaryanddetails.
qstringA string used to find matching items by name, e.g.
q=test.
tagstringList items with the specified tag.
trashedbooleanIndicates whether trashed items should be listed (default is
false). Specifynullto list both trashed and non-trashed items.
order_bystringSpecifies the sort order and direction for the listing, e.g.
order_by=idororder_by=id+desc.
skipintegerThe number of items to skip. Used together with
taketo return a specific range of items (for pagination).
takeintegerMaximum number of items to return in the listing. Should be a value between
1and100. Default is25.
count_onlybooleantrueto count the number of matching items instead of listing them; when specified the response will only contain thecountproperty.
Example request
curl {WEAVY-URL}/api/apps/acme-posts/posts?take=25
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Response codes
200 OK
401 Unauthorized
404 Not Found
Response schema
{
"data": [
{
"id": "integer",
"text": "string",
"html": "string",
"plain": "string",
"metadata": "object",
"tags": [
"string"
],
"is_starred": "boolean",
"is_subscribed": "boolean",
"is_trashed": "boolean",
"created_at": "string",
"updated_at": "string"
}
],
"start": "integer",
"end": "integer",
"count": "integer"
}
Trash post
Move a post to the trash.
POST /api/posts/{id}/trash
Path parameters
idintegerrequiredId of the post to trash.
Example request
curl -X POST {WEAVY-URL}/api/posts/1/trash
-H "Authorization: Bearer {API-KEY}"
Response codes
204 No Content
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
Restore post
Restore a post from the trash.
POST /api/posts/{id}/restore
Path parameters
idintegerrequiredId of the post to restore.
Example request
curl -X POST {WEAVY-URL}/api/posts/1/restore
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Response codes
204 No Content
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
Delete post
Delete a post.
DELETE /api/posts/{id}
Path parameters
idintegerrequiredId of the post.
Example request
curl -X DELETE {WEAVY-URL}/api/posts/1
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Response codes
204 No Content
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found