Directories

Api for user directories.

Create directory

Creates a user directory.

POST /api/directories
Body parameters
name string required

Unique directory name.

Response codes

201 Created

{
  "id": "integer",
  "name": "string"
}

409 Conflict

Code sample
curl https://{WEAVY-SERVER}/api/directories
-H "Authorization: Bearer {API-KEY}"
--json "{ 'name': 'acme' }"

List directories

List directories.

GET /api/directories
Query parameters
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/directories?top=10&q=acme
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"

Get directory

Get a directory by id.

GET /api/directories/{id}
Path parameters
id integer required

Id of directory.

Response codes

200 Success

{
  "id": "integer",
  "name": "string"
}

404 Not Found

Code sample
curl https://{WEAVY-SERVER}/api/directories/1
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"

Update directory

Update (rename) a directory.

PATCH /api/directories/{id}
Path parameters
id integer required
Body parameters
tracked_properties object
name string required

Unique directory name.

Response codes

204 No Content

404 Not Found

400 Bad Request

Code sample
curl -X PATCH https://{WEAVY_SERVER}/api/directories/1
-H "Authorization: Bearer {API-KEY}"
--json "{ 'name': 'New name' }"

Delete directory

Delete a directory.

DELETE /api/directories/{id}
Path parameters
id integer required

Directory id.

Response codes

204 No Content

Code sample
curl -X DELETE https://{WEAVY_SERVER}/api/directories/1
-H "Authorization: Bearer {API-KEY}"

Get directory by name

Get a directory by name.

GET /api/directories/{name}
Path parameters
name string required

Name of directory.

Response codes

200 Success

{
  "id": "integer",
  "name": "string"
}
Code sample
curl https://{WEAVY-SERVER}/api/directories/acme
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"

List directory members

List the members of a directory.

GET /api/directories/{id}/members
Path parameters
id integer required

Directory id.

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/directories/1/members
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Weavy Docs