Messages
The Messages API supports managing chat messages.
Create message
Creates a new message in the specified app (chat or conversation).
POST /api/apps/{app}/messages
Path parameters
app
string
requiredApp identifier (
id
oruid
).
Body parameters
blobs
array of integers
Ids of blobs to attach.
embed_id
integer
Id of embed to attach.
meeting_id
integer
Id of meeting to attach.
options
array of objects
List of poll options to attach.
text
string
The message text.
metadata
object
Additional metadata properties, e.g.
{ "color": "blue", "size": "XL" }
.
tags
array of strings
A list of tags to associate with the item.
Example request
curl {WEAVY-URL}/api/apps/acme-chat/messages
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
--json "{ 'text': 'This is a message' }"
Response codes
201 Created
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
422 Validation Failed
Response schema
{
"id": "integer",
"app": {
"id": "integer",
"type": "string",
"uid": "string",
"access": "string",
"directory_id": "integer",
"display_name": "string",
"name": "string",
"description": "string",
"archive_url": "string",
"avatar_url": "string",
"metadata": "object",
"tags": [
"string"
],
"created_at": "string",
"updated_at": "string",
"is_trashed": "boolean",
"is_starred": "boolean",
"is_subscribed": "boolean",
"permissions": [
"string"
]
},
"parent": {
"id": "integer",
"type": "string"
},
"text": "string",
"html": "string",
"plain": "string",
"embed": {
"id": "integer",
"type": "string",
"title": "string",
"description": "string",
"author_name": "string",
"author_url": "string",
"provider_name": "string",
"provider_url": "string",
"cache_age": "integer",
"thumbnail_url": "string",
"thumbnail_width": "integer",
"thumbnail_height": "integer",
"url": "string",
"width": "integer",
"height": "integer",
"html": "string",
"original_url": "string"
},
"meeting": {
"id": "integer",
"provider": "string",
"provider_id": "string",
"join_url": "string",
"code": "string",
"created_at": "string",
"metadata": "object"
},
"attachments": {
"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",
"display_name": "string",
"avatar_url": "string",
"email": "string",
"given_name": "string",
"middle_name": "string",
"name": "string",
"family_name": "string",
"nickname": "string",
"phone_number": "string",
"comment": "string",
"metadata": "object",
"tags": [
"string"
],
"presence": "string",
"directory_id": "integer",
"created_at": "string",
"updated_at": "string",
"is_bot": "boolean",
"is_suspended": "boolean",
"is_trashed": "boolean"
},
"updated_at": "string",
"updated_by": {
"id": "integer",
"uid": "string",
"display_name": "string",
"avatar_url": "string",
"email": "string",
"given_name": "string",
"middle_name": "string",
"name": "string",
"family_name": "string",
"nickname": "string",
"phone_number": "string",
"comment": "string",
"metadata": "object",
"tags": [
"string"
],
"presence": "string",
"directory_id": "integer",
"created_at": "string",
"updated_at": "string",
"is_bot": "boolean",
"is_suspended": "boolean",
"is_trashed": "boolean"
}
}
Get message
Gets a message by id.
GET /api/messages/{id}
Path parameters
id
integer
requiredId of the message.
Query parameters
trashed
boolean
true
to return message even if trashed.
Example request
curl {WEAVY-URL}/api/messages/1
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Response codes
200 OK
401 Unauthorized
404 Not Found
Response schema
{
"id": "integer",
"app": {
"id": "integer",
"type": "string",
"uid": "string",
"access": "string",
"directory_id": "integer",
"display_name": "string",
"name": "string",
"description": "string",
"archive_url": "string",
"avatar_url": "string",
"metadata": "object",
"tags": [
"string"
],
"created_at": "string",
"updated_at": "string",
"is_trashed": "boolean",
"is_starred": "boolean",
"is_subscribed": "boolean",
"permissions": [
"string"
]
},
"parent": {
"id": "integer",
"type": "string"
},
"text": "string",
"html": "string",
"plain": "string",
"embed": {
"id": "integer",
"type": "string",
"title": "string",
"description": "string",
"author_name": "string",
"author_url": "string",
"provider_name": "string",
"provider_url": "string",
"cache_age": "integer",
"thumbnail_url": "string",
"thumbnail_width": "integer",
"thumbnail_height": "integer",
"url": "string",
"width": "integer",
"height": "integer",
"html": "string",
"original_url": "string"
},
"meeting": {
"id": "integer",
"provider": "string",
"provider_id": "string",
"join_url": "string",
"code": "string",
"created_at": "string",
"metadata": "object"
},
"attachments": {
"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",
"display_name": "string",
"avatar_url": "string",
"email": "string",
"given_name": "string",
"middle_name": "string",
"name": "string",
"family_name": "string",
"nickname": "string",
"phone_number": "string",
"comment": "string",
"metadata": "object",
"tags": [
"string"
],
"presence": "string",
"directory_id": "integer",
"created_at": "string",
"updated_at": "string",
"is_bot": "boolean",
"is_suspended": "boolean",
"is_trashed": "boolean"
},
"updated_at": "string",
"updated_by": {
"id": "integer",
"uid": "string",
"display_name": "string",
"avatar_url": "string",
"email": "string",
"given_name": "string",
"middle_name": "string",
"name": "string",
"family_name": "string",
"nickname": "string",
"phone_number": "string",
"comment": "string",
"metadata": "object",
"tags": [
"string"
],
"presence": "string",
"directory_id": "integer",
"created_at": "string",
"updated_at": "string",
"is_bot": "boolean",
"is_suspended": "boolean",
"is_trashed": "boolean"
}
}
Update message
Updates a message.
PATCH /api/messages/{id}
Path parameters
id
integer
requiredId of the message.
Body parameters
attachments
array of integers
Ids of attached files.
blobs
array of integers
Ids of additional blobs to attach.
embed_id
integer
Id of embed to attach.
meeting_id
integer
Id of meeting to attach.
options
array of objects
List of poll options for the item.
text
string
The message text.
metadata
object
Additional metadata properties, e.g.
{ "color": "blue", "size": "XL" }
.
tags
array of strings
A list of tags to associate with the item.
Example request
curl -X PATCH {WEAVY-URL}/api/messages/1
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
--json "{ 'text': 'This is an updated message' }"
Response codes
200 OK
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
422 Validation Failed
Response schema
{
"id": "integer",
"app": {
"id": "integer",
"type": "string",
"uid": "string",
"access": "string",
"directory_id": "integer",
"display_name": "string",
"name": "string",
"description": "string",
"archive_url": "string",
"avatar_url": "string",
"metadata": "object",
"tags": [
"string"
],
"created_at": "string",
"updated_at": "string",
"is_trashed": "boolean",
"is_starred": "boolean",
"is_subscribed": "boolean",
"permissions": [
"string"
]
},
"parent": {
"id": "integer",
"type": "string"
},
"text": "string",
"html": "string",
"plain": "string",
"embed": {
"id": "integer",
"type": "string",
"title": "string",
"description": "string",
"author_name": "string",
"author_url": "string",
"provider_name": "string",
"provider_url": "string",
"cache_age": "integer",
"thumbnail_url": "string",
"thumbnail_width": "integer",
"thumbnail_height": "integer",
"url": "string",
"width": "integer",
"height": "integer",
"html": "string",
"original_url": "string"
},
"meeting": {
"id": "integer",
"provider": "string",
"provider_id": "string",
"join_url": "string",
"code": "string",
"created_at": "string",
"metadata": "object"
},
"attachments": {
"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",
"display_name": "string",
"avatar_url": "string",
"email": "string",
"given_name": "string",
"middle_name": "string",
"name": "string",
"family_name": "string",
"nickname": "string",
"phone_number": "string",
"comment": "string",
"metadata": "object",
"tags": [
"string"
],
"presence": "string",
"directory_id": "integer",
"created_at": "string",
"updated_at": "string",
"is_bot": "boolean",
"is_suspended": "boolean",
"is_trashed": "boolean"
},
"updated_at": "string",
"updated_by": {
"id": "integer",
"uid": "string",
"display_name": "string",
"avatar_url": "string",
"email": "string",
"given_name": "string",
"middle_name": "string",
"name": "string",
"family_name": "string",
"nickname": "string",
"phone_number": "string",
"comment": "string",
"metadata": "object",
"tags": [
"string"
],
"presence": "string",
"directory_id": "integer",
"created_at": "string",
"updated_at": "string",
"is_bot": "boolean",
"is_suspended": "boolean",
"is_trashed": "boolean"
}
}
List messages
List messages.
GET /api/messages
Query parameters
around
integer
A message id. Used to find results "around" a specific message.
q
string
A query used to find matching items.
tag
string
List items with the specified tag.
trashed
boolean
Indicates whether trashed items should be listed (default is
false
). Specifynull
to return both trashed and non-trashed items.
order_by
string
Specifies the sort order and direction for the listing, e.g. "
id
" or "id+desc
"
skip
integer
The number of items to skip. Used together with
take
to return a specific range of items (for pagination).
take
integer
Maximum number of items to return in the listing. Should be a value between
1
and100
. Default is25
.
count_only
boolean
true
to only return the number of matching items; when this is specified the response will only contain thecount
property.
Example request
curl {WEAVY-URL}/api/messages
-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 messages
List messages in the specified app (chat or conversation).
GET /api/apps/{app}/messages
Path parameters
app
string
requiredApp identifier (
id
oruid
)
Query parameters
around
integer
A message id. Used to find results "around" a specific message.
q
string
A query used to find matching items.
tag
string
List items with the specified tag.
trashed
boolean
Indicates whether trashed items should be listed (default is
false
). Specifynull
to return both trashed and non-trashed items.
order_by
string
Specifies the sort order and direction for the listing, e.g. "
id
" or "id+desc
"
skip
integer
The number of items to skip. Used together with
take
to return a specific range of items (for pagination).
take
integer
Maximum number of items to return in the listing. Should be a value between
1
and100
. Default is25
.
count_only
boolean
true
to only return the number of matching items; when this is specified the response will only contain thecount
property.
Example request
curl {WEAVY-URL}/api/apps/acme-chat/messages?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 message
Move a message to the trash.
POST /api/messages/{id}/trash
Path parameters
id
integer
requiredId of the message to trash.
Example request
curl -X POST {WEAVY-URL}/api/messages/1/trash
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Response codes
204 No Content
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
Restore message
Restore a message from the trash.
POST /api/messages/{id}/restore
Path parameters
id
integer
requiredId of the message to restore.
Example request
curl -X POST {WEAVY-URL}/api/messages/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 message
Permanently delete a message.
DELETE /api/messages/{id}
Path parameters
id
integer
requiredId of the message.
Example request
curl -X DELETE {WEAVY-URL}/api/messages/1
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Response codes
204 No Content
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found