Apps
The Apps API enables you to manage apps.
Create app
POST /api/apps
Creates a new app.
Sample request
$ curl {WEAVY_SERVER}/api/apps
-H "Authorization: Bearer {ACCESS_TOKEN | WEAVY_APIKEY}"
-H "Content-Type: application/json"
-d "{ 'uid': 'chat-project-x', 'type': 'chat', 'name': 'Chat for Project X' }"
Request body
application/json
{
"uid": "string",
"type": "string",
"name?": "string",
"description?": "string",
"metadata?": {},
"tags?": [
"string"
]
}
Note. Properties marked with ? are optional.
Responses
Status code 201
application/json
{
"id": "integer",
"type": "string",
"uid": "string",
"display_name": "string",
"name": "string",
"description": "string",
"archive_url": "string",
"avatar_url": "string",
"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"
}
Status code 400
application/json
{
"type": "string",
"title": "string",
"status": "integer",
"detail": "string",
"instance": "string"
}
List apps
GET /api/apps
Get a list of apps.
Sample request
$ curl {WEAVY_SERVER}/api/apps?top=10
-H "Authorization: Bearer {ACCESS_TOKEN | WEAVY_APIKEY}"
Parameters
Name | Type | Required | Description |
---|---|---|---|
contextual | boolean | False | |
type | string | False | |
q | string | False | |
tag | string | False | |
trashed | boolean | False | |
order_by | string | False | |
top | integer | False | |
skip | integer | False | |
count | boolean | False | |
count_only | boolean | False |
Responses
Status code 200
application/json
{
"data": [
"object"
],
"start": "integer",
"end": "integer",
"count": "integer"
}
Initialize app
POST /api/apps/init
Initialize an app (get existing or create new) and ensure user is member (if specified).
Sample request
$ curl {WEAVY_SERVER}/api/apps/init
-H "Authorization: Bearer {ACCESS_TOKEN | WEAVY_APIKEY}"
-H "Content-Type: application/json"
-d "{'app': { 'uid': 'chat-project-x', 'type': 'chat', 'name': 'Chat for Project X' }, 'user': { 'uid': 'user-1' } }"
Request body
application/json
{
"app": {
"uid": "string",
"type": "string",
"name?": "string",
"description?": "string",
"metadata?": {},
"tags?": [
"string"
]
},
"user?": {
"uid": "string"
}
}
Note. Properties marked with ? are optional.
Responses
Status code 200
application/json
{
"id": "integer",
"type": "string",
"uid": "string",
"display_name": "string",
"name": "string",
"description": "string",
"archive_url": "string",
"avatar_url": "string",
"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"
}
Get app
GET /api/apps/{id}
Get an app by id.
Sample request
$ curl {WEAVY_SERVER}/api/apps/1
-H "Authorization: Bearer {ACCESS_TOKEN | WEAVY_APIKEY}"
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | True | The id of app |
trashed | boolean | False | `true` to return app if trashed |
Responses
Status code 200
application/json
{
"id": "integer",
"type": "string",
"uid": "string",
"display_name": "string",
"name": "string",
"description": "string",
"archive_url": "string",
"avatar_url": "string",
"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"
}
Update app
PATCH /api/apps/{id}
Update an app.
Sample request
$ curl -X PATCH {WEAVY_SERVER}/api/apps/2
-H "Authorization: Bearer {ACCESS_TOKEN | WEAVY_APIKEY}"
-H "Content-Type: application/json"
-d "{'app': { 'uid': 'chat-project-x', 'type': 'chat', 'name': 'Chat for Project X' }, 'user': { 'uid': 'user-1' } }"
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | True | Id of app. |
Request body
application/json
{
"uid?": "string",
"name?": "string",
"description?": "string",
"metadata?": {},
"tags?": [
"string"
]
}
Note. Properties marked with ? are optional.
Responses
Status code 204
No Content
Status code 404
application/json
{
"type": "string",
"title": "string",
"status": "integer",
"detail": "string",
"instance": "string"
}
Status code 400
application/json
{
"type": "string",
"title": "string",
"status": "integer",
"detail": "string",
"instance": "string"
}
Delete app
DELETE /api/apps/{id}
Delete an app.
Sample request
$ curl -X DELETE {WEAVY_SERVER}/api/apps/1
-H "Authorization: Bearer {ACCESS_TOKEN | WEAVY_APIKEY}"
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | True | Id of app. |
Responses
Status code 204
No Content
Get app by uid
GET /api/apps/{uid}
Get an app by uid.
Sample request
$ curl {WEAVY_SERVER}/api/apps/chat-1
-H "Authorization: Bearer {ACCESS_TOKEN | WEAVY_APIKEY}"
Parameters
Name | Type | Required | Description |
---|---|---|---|
uid | string | True | Unique identifier of the app. |
trashed | boolean | False |
Responses
Status code 200
application/json
{
"id": "integer",
"type": "string",
"uid": "string",
"display_name": "string",
"name": "string",
"description": "string",
"archive_url": "string",
"avatar_url": "string",
"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"
}
Subscribe to notifications
POST /api/apps/{id}/subscribe
Subscribe to notifications for activity in an app.
Sample request
$ curl -X POST {WEAVY_SERVER}/api/apps/1/subscribe
-H "Authorization: Bearer {ACCESS_TOKEN | WEAVY_APIKEY}"
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | True | Id of the app. |
Responses
Status code 200
application/json
{
"id": "integer",
"type": "string",
"uid": "string",
"display_name": "string",
"name": "string",
"description": "string",
"archive_url": "string",
"avatar_url": "string",
"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"
}
Unsubscribe to notifications
POST /api/apps/{id}/unsubscribe
Unsubscribe to notifications for activity in an app.
Sample request
$ curl -X POST {WEAVY_SERVER}/api/apps/1/unsubscribe
-H "Authorization: Bearer {ACCESS_TOKEN | WEAVY_APIKEY}"
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | True |
Responses
Status code 200
application/json
{
"id": "integer",
"type": "string",
"uid": "string",
"display_name": "string",
"name": "string",
"description": "string",
"archive_url": "string",
"avatar_url": "string",
"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"
}
Trash app
POST /api/apps/{id}/trash
Move an app to the trash.
Sample request
$ curl -X POST {WEAVY_SERVER}/api/apps/1/trash
-H "Authorization: Bearer {ACCESS_TOKEN | WEAVY_APIKEY}"
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | True | Id of the app to trash. |
Responses
Status code 200
application/json
{
"id": "integer",
"type": "string",
"uid": "string",
"display_name": "string",
"name": "string",
"description": "string",
"archive_url": "string",
"avatar_url": "string",
"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"
}
Status code 404
application/json
{
"type": "string",
"title": "string",
"status": "integer",
"detail": "string",
"instance": "string"
}
Status code 400
application/json
{
"type": "string",
"title": "string",
"status": "integer",
"detail": "string",
"instance": "string"
}
Restore app
POST /api/apps/{id}/restore
Restore an app from the trash.
Sample request
$ curl -X POST {WEAVY_SERVER}/api/apps/1/restore
-H "Authorization: Bearer {ACCESS_TOKEN | WEAVY_APIKEY}"
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | True | Id of the app to restore. |
Responses
Status code 200
application/json
{
"id": "integer",
"type": "string",
"uid": "string",
"display_name": "string",
"name": "string",
"description": "string",
"archive_url": "string",
"avatar_url": "string",
"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"
}
List app members
GET /api/apps/{id}/members
List the members of an app.
Sample request
$ curl {WEAVY_SERVER}/api/apps/1/members
-H "Authorization: Bearer {ACCESS_TOKEN | WEAVY_APIKEY}"
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | True | App id |
suspended | boolean | False | |
q | string | False | |
tag | string | False | |
trashed | boolean | False | |
order_by | string | False | |
top | integer | False | |
skip | integer | False | |
count | boolean | False | |
count_only | boolean | False |
Responses
Status code 200
application/json
{
"data": [
"object"
],
"start": "integer",
"end": "integer",
"count": "integer"
}
Add members to app
POST /api/apps/{id}/members
Add multiple app members.
Sample request
$ curl {WEAVY_SERVER}/api/apps/1/members
-H "Authorization: Bearer {ACCESS_TOKEN | WEAVY_APIKEY}"
-H "Content-Type: application/json"
-d "[1, 4, 14]"
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | True | App id. |
Request body
application/json
[
"integer"
]
Note. Properties marked with ? are optional.
Responses
Status code 200
Success
Remove members from app
DELETE /api/apps/{id}/members
Remove multiple app members.
Sample request
$ curl -X DELETE {WEAVY_SERVER}/api/apps/1/members
-H "Authorization: Bearer {ACCESS_TOKEN | WEAVY_APIKEY}"
-H "Content-Type: application/json"
-d "[1, 4]"
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | True | App id. |
Request body
application/json
[
"integer"
]
Note. Properties marked with ? are optional.
Responses
Status code 200
Success
Add member to app
PUT /api/apps/{id}/members/{userid}
Add a single app member.
Sample request
$ curl -X PUT {WEAVY_SERVER}/api/apps/1/members/2
-H "Authorization: Bearer {ACCESS_TOKEN | WEAVY_APIKEY}"
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | True | App id. |
userid | integer | True | Id of user to add. |
Responses
Status code 200
Success
Remove member from app
DELETE /api/apps/{id}/members/{userid}
Remove a single app member.
Sample request
$ curl -X DELETE {WEAVY_SERVER}/api/apps/1/members/2
-H "Authorization: Bearer {ACCESS_TOKEN | WEAVY_APIKEY}"
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | True | App id. |
userid | integer | True | Id of user to remove. |
Responses
Status code 200
Success