Apps
The Apps API enables you to manage apps.
Create app
Creates a contextual app with the specified uid
.
POST /api/apps
Body parameters
uid
string requiredA string that uniquely identifies the app, for instance a product id or URL (cannot contain whitespace and must contain at least one non-digit).
type
string requiredType of app to create (
chat
,files
orposts
).
name
stringDisplay name for the app.
description
stringApp description.
metadata
objectAdditional properties to associate with the app, e.g.
{ "color": "blue", "size": "XL" }
.
tags
array of stringsA list of tags to associate with the app.
Response codes
201 Created
{
"id": "integer",
"type": "string",
"uid": "string",
"display_name": "string",
"name": "string",
"description": "string",
"archive_url": "string",
"avatar_url": "string",
"metadata": "object",
"tags": [
"string"
],
"created_at": "string",
"created_by_id": "integer",
"modified_at": "string",
"modified_by_id": "integer",
"member_count": "integer",
"members": [
"object"
],
"is_starred": "boolean",
"is_subscribed": "boolean",
"is_trashed": "boolean"
}
400 Bad Request
Code sample
curl https://{WEAVY-SERVER}/api/apps
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
--json "{ 'uid': 'chat-project-x', 'type': 'chat', 'name': 'Chat for Project X' }"
List apps
Get a list of apps.
GET /api/apps
Query parameters
contextual
booleantrue
to lists contextual apps,false
to list non-contextual apps; when not specified both types are listed.
type
stringGuid of app type to list.
q
stringA query used to find matching items.
tag
stringList items with the specified tag.
trashed
booleanIndicates whether trashed items should be listed (default is
false
). Specifynull
to return both trashed and non-trashed items.
order_by
stringSpecifies the sort order and direction for the listing, e.g. "
name
" or "name+desc
"
top
integerMaximum number of items to return in the listing. Should be a value between
0
and100
. Default is25
.
skip
integerThe number of items to skip. Used together with
top
to return a specific range of items (for pagination).
count
booleanfalse
to skip counting the total number of matching items; default istrue
.
count_only
booleantrue
to only return the number of matching items; when this is specified the response will only contain thecount
property.
Response codes
200 Success
{
"data": [
"object"
],
"start": "integer",
"end": "integer",
"count": "integer"
}
Code sample
curl https://{WEAVY-SERVER}/api/apps?top=10
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Initialize app
Initialize an app (get existing or create new) and ensure user is member (if specified).
POST /api/apps/init
Body parameters
app
object required-
uid
string requiredA string that uniquely identifies the app, for instance a product id or URL (cannot contain whitespace and must contain at least one non-digit).
type
string requiredType of app to create (
chat
,files
orposts
).
name
stringDisplay name for the app.
description
stringApp description.
metadata
objectAdditional properties to associate with the app, e.g.
{ "color": "blue", "size": "XL" }
.
tags
array of stringsA list of tags to associate with the app.
user
object-
uid
string requiredUnique user identifier (cannot contain whitespace and must contain at least one non-digit).
Response codes
200 Success
{
"id": "integer",
"type": "string",
"uid": "string",
"display_name": "string",
"name": "string",
"description": "string",
"archive_url": "string",
"avatar_url": "string",
"metadata": "object",
"tags": [
"string"
],
"created_at": "string",
"created_by_id": "integer",
"modified_at": "string",
"modified_by_id": "integer",
"member_count": "integer",
"members": [
"object"
],
"is_starred": "boolean",
"is_subscribed": "boolean",
"is_trashed": "boolean"
}
Code sample
curl https://{WEAVY-SERVER}/api/apps/init
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
--json "{'app': { 'uid': 'chat-project-x', 'type': 'chat', 'name': 'Chat for Project X' }, 'user': { 'uid': 'user-1' } }"
Get app
Get an app by id.
GET /api/apps/{id}
Path parameters
id
integer requiredId of app.
Query parameters
trashed
booleantrue
to return app even if trashed, otherwisefalse
.
Response codes
200 Success
{
"id": "integer",
"type": "string",
"uid": "string",
"display_name": "string",
"name": "string",
"description": "string",
"archive_url": "string",
"avatar_url": "string",
"metadata": "object",
"tags": [
"string"
],
"created_at": "string",
"created_by_id": "integer",
"modified_at": "string",
"modified_by_id": "integer",
"member_count": "integer",
"members": [
"object"
],
"is_starred": "boolean",
"is_subscribed": "boolean",
"is_trashed": "boolean"
}
Code sample
curl https://{WEAVY-SERVER}/api/apps/1
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Update app
Update an app.
PATCH /api/apps/{id}
Path parameters
id
integer requiredId of app.
Body parameters
uid
stringA string that uniquely identifies the app, for instance a product id or URL (cannot contain whitespace and must contain at least one non-digit).
name
stringDisplay name for the app.
description
stringApp description.
metadata
objectAdditional properties to associate with the app, e.g.
{ "color": "blue", "size": "XL" }
.
tags
array of stringsA list of tags to associate with the app.
Response codes
204 No Content
404 Not Found
400 Bad Request
Code sample
$ curl -X PATCH {WEAVY_SERVER}/api/apps/2
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
-H "Content-Type: application/json"
-d "{'app': { 'uid': 'chat-project-x', 'type': 'chat', 'name': 'Chat for Project X' }, 'user': { 'uid': 'user-1' } }"
Delete app
Permanently deletes an app and all it's content.
DELETE /api/apps/{id}
Path parameters
id
integer requiredId of app.
Response codes
204 No Content
Code sample
$ curl -X DELETE {WEAVY_SERVER}/api/apps/1
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Get app by uid
Get an app by it's unique identifier (uid
).
GET /api/apps/{uid}
Path parameters
uid
string requiredUnique identifier of the app.
Query parameters
trashed
booleantrue
to return app even if trashed, otherwisefalse
.
Response codes
200 Success
{
"id": "integer",
"type": "string",
"uid": "string",
"display_name": "string",
"name": "string",
"description": "string",
"archive_url": "string",
"avatar_url": "string",
"metadata": "object",
"tags": [
"string"
],
"created_at": "string",
"created_by_id": "integer",
"modified_at": "string",
"modified_by_id": "integer",
"member_count": "integer",
"members": [
"object"
],
"is_starred": "boolean",
"is_subscribed": "boolean",
"is_trashed": "boolean"
}
Code sample
curl https://{WEAVY-SERVER}/api/apps/chat-1
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Subscribe to notifications
Subscribe to notifications for activity in an app.
POST /api/apps/{id}/subscribe
Path parameters
id
integer requiredId of app.
Response codes
200 Success
{
"id": "integer",
"type": "string",
"uid": "string",
"display_name": "string",
"name": "string",
"description": "string",
"archive_url": "string",
"avatar_url": "string",
"metadata": "object",
"tags": [
"string"
],
"created_at": "string",
"created_by_id": "integer",
"modified_at": "string",
"modified_by_id": "integer",
"member_count": "integer",
"members": [
"object"
],
"is_starred": "boolean",
"is_subscribed": "boolean",
"is_trashed": "boolean"
}
Code sample
$ curl -X POST {WEAVY_SERVER}/api/apps/1/subscribe
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Unsubscribe to notifications
Unsubscribe to notifications for activity in an app.
POST /api/apps/{id}/unsubscribe
Path parameters
id
integer required
Response codes
200 Success
{
"id": "integer",
"type": "string",
"uid": "string",
"display_name": "string",
"name": "string",
"description": "string",
"archive_url": "string",
"avatar_url": "string",
"metadata": "object",
"tags": [
"string"
],
"created_at": "string",
"created_by_id": "integer",
"modified_at": "string",
"modified_by_id": "integer",
"member_count": "integer",
"members": [
"object"
],
"is_starred": "boolean",
"is_subscribed": "boolean",
"is_trashed": "boolean"
}
Code sample
$ curl -X POST {WEAVY_SERVER}/api/apps/1/unsubscribe
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Trash app
Move an app to the trash.
POST /api/apps/{id}/trash
Path parameters
id
integer requiredId of app to trash.
Response codes
200 Success
{
"id": "integer",
"type": "string",
"uid": "string",
"display_name": "string",
"name": "string",
"description": "string",
"archive_url": "string",
"avatar_url": "string",
"metadata": "object",
"tags": [
"string"
],
"created_at": "string",
"created_by_id": "integer",
"modified_at": "string",
"modified_by_id": "integer",
"member_count": "integer",
"members": [
"object"
],
"is_starred": "boolean",
"is_subscribed": "boolean",
"is_trashed": "boolean"
}
404 Not Found
400 Bad Request
Code sample
$ curl -X POST {WEAVY_SERVER}/api/apps/1/trash
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Restore app
Restore an app from the trash.
POST /api/apps/{id}/restore
Path parameters
id
integer requiredId of app to restore.
Response codes
200 Success
{
"id": "integer",
"type": "string",
"uid": "string",
"display_name": "string",
"name": "string",
"description": "string",
"archive_url": "string",
"avatar_url": "string",
"metadata": "object",
"tags": [
"string"
],
"created_at": "string",
"created_by_id": "integer",
"modified_at": "string",
"modified_by_id": "integer",
"member_count": "integer",
"members": [
"object"
],
"is_starred": "boolean",
"is_subscribed": "boolean",
"is_trashed": "boolean"
}
Code sample
$ curl -X POST {WEAVY_SERVER}/api/apps/1/restore
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
List app members
List the members of an app.
GET /api/apps/{id}/members
Path parameters
id
integer requiredId of app.
Query parameters
suspended
booleanIndicates whether to list suspended members or not,
null
returns all members.
q
stringA query used to find matching items.
tag
stringList items with the specified tag.
trashed
booleanIndicates whether trashed items should be listed (default is
false
). Specifynull
to return both trashed and non-trashed items.
order_by
stringSpecifies the sort order and direction for the listing, e.g. "
name
" or "name+desc
"
top
integerMaximum number of items to return in the listing. Should be a value between
0
and100
. Default is25
.
skip
integerThe number of items to skip. Used together with
top
to return a specific range of items (for pagination).
count
booleanfalse
to skip counting the total number of matching items; default istrue
.
count_only
booleantrue
to only return the number of matching items; when this is specified the response will only contain thecount
property.
Response codes
200 Success
{
"data": [
"object"
],
"start": "integer",
"end": "integer",
"count": "integer"
}
Code sample
curl https://{WEAVY-SERVER}/api/apps/1/members
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Add members to app
Add multiple app members.
POST /api/apps/{id}/members
Path parameters
id
integer requiredId of app.
Body parameters
array of integers required
Ids of users to add.
Response codes
200 Success
Code sample
curl https://{WEAVY-SERVER}/api/apps/1/members
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
-H "Content-Type: application/json"
-d "[1, 4, 14]"
Remove members from app
Remove multiple app members.
DELETE /api/apps/{id}/members
Path parameters
id
integer requiredId of app.
Body parameters
array of integers required
Ids of users to remove.
Response codes
200 Success
Code sample
$ curl -X DELETE {WEAVY_SERVER}/api/apps/1/members
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
-H "Content-Type: application/json"
-d "[1, 4]"
Add member to app
Add a single app member.
PUT /api/apps/{id}/members/{userid}
Path parameters
id
integer requiredId of app.
userid
integer requiredId of user to add.
Response codes
200 Success
Code sample
$ curl -X PUT {WEAVY_SERVER}/api/apps/1/members/2
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Remove member from app
Remove a single app member.
DELETE /api/apps/{id}/members/{userid}
Path parameters
id
integer requiredApp id.
userid
integer requiredId of user to remove.
Response codes
200 Success
Code sample
$ curl -X DELETE {WEAVY_SERVER}/api/apps/1/members/2
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"