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 required

A 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 required

Type of app to create (chat, files or posts).

name string

Display name for the app.

description string

App description.

metadata object

Additional properties to associate with the app, e.g. { "color": "blue", "size": "XL" }.

tags array of strings

A 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 boolean

true to lists contextual apps, false to list non-contextual apps; when not specified both types are listed.

type string

Guid of app type to list.

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). Specify null to return both trashed and non-trashed items.

order_by string

Specifies the sort order and direction for the listing, e.g. "name" or "name+desc"

top integer

Maximum number of items to return in the listing. Should be a value between 0 and 100. Default is 25.

skip integer

The number of items to skip. Used together with top to return a specific range of items (for pagination).

count boolean

false to skip counting the total number of matching items; default is true.

count_only boolean

true to only return the number of matching items; when this is specified the response will only contain the count 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 required

A 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 required

Type of app to create (chat, files or posts).

name string

Display name for the app.

description string

App description.

metadata object

Additional properties to associate with the app, e.g. { "color": "blue", "size": "XL" }.

tags array of strings

A list of tags to associate with the app.

user object
uid string required

Unique 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 required

Id of app.

Query parameters
trashed boolean

true to return app even if trashed, otherwise false.

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 required

Id of app.

Body parameters
uid string

A 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 string

Display name for the app.

description string

App description.

metadata object

Additional properties to associate with the app, e.g. { "color": "blue", "size": "XL" }.

tags array of strings

A 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 required

Id 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 required

Unique identifier of the app.

Query parameters
trashed boolean

true to return app even if trashed, otherwise false.

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 required

Id 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 required

Id 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 required

Id 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 required

Id of app.

Query parameters
suspended boolean

Indicates whether to list suspended members or not, null returns all members.

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). Specify null to return both trashed and non-trashed items.

order_by string

Specifies the sort order and direction for the listing, e.g. "name" or "name+desc"

top integer

Maximum number of items to return in the listing. Should be a value between 0 and 100. Default is 25.

skip integer

The number of items to skip. Used together with top to return a specific range of items (for pagination).

count boolean

false to skip counting the total number of matching items; default is true.

count_only boolean

true to only return the number of matching items; when this is specified the response will only contain the count 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 required

Id 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 required

Id 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 required

Id of app.

userid integer required

Id 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 required

App id.

userid integer required

Id 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}"
Weavy Docs