Folders

Get User Personal Folder

get

Get the user's personal folder if it exists.

Authorizations
OAuth2passwordRequired
Token URL:
Responses
200

Successful Response

application/json
Responseany of
or
nullOptional
get
/folders/me
GET /folders/me HTTP/1.1
Host: api.stack-ai.com
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
200

Successful Response

{
  "id": "ca45f483-db07-41e1-ab9a-1c610614416a",
  "name": "folder1",
  "user_id_access_list": [
    "ca45f483-db07-41e1-ab9a-1c610614416b",
    "ca45f483-db07-41e1-ab9a-1c610614416c"
  ],
  "group_id_access_list": [
    "ca45f483-db07-41e1-ab9a-1c610614416b",
    "ca45f483-db07-41e1-ab9a-1c610614416c"
  ],
  "personal_folder_owner_id": "ca45f483-db07-41e1-ab9a-1c610614416a"
}

Get Folder

get
Authorizations
OAuth2passwordRequired
Token URL:
Path parameters
folder_idstringRequired
Responses
200

Successful Response

application/json
get
/folders/{folder_id}
GET /folders/{folder_id} HTTP/1.1
Host: api.stack-ai.com
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
  "id": "ca45f483-db07-41e1-ab9a-1c610614416a",
  "name": "folder1",
  "user_id_access_list": [
    "ca45f483-db07-41e1-ab9a-1c610614416b",
    "ca45f483-db07-41e1-ab9a-1c610614416c"
  ],
  "group_id_access_list": [
    "ca45f483-db07-41e1-ab9a-1c610614416b",
    "ca45f483-db07-41e1-ab9a-1c610614416c"
  ],
  "personal_folder_owner_id": "ca45f483-db07-41e1-ab9a-1c610614416a"
}

Delete Folder

delete

Delete a folder in the current organization.

Authorizations
OAuth2passwordRequired
Token URL:
Path parameters
folder_idstringRequired
Responses
delete
/folders/{folder_id}
DELETE /folders/{folder_id} HTTP/1.1
Host: api.stack-ai.com
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*

No content

Patch Folder

patch

Update a folder in the current organization.

Authorizations
OAuth2passwordRequired
Token URL:
Path parameters
folder_idstringRequired
Body
nameany ofOptional
string · max: 128Optional

The name of the folder, it is used like a path

Example: folder1
or
nullOptional
accessany ofOptional
string[]OptionalDeprecated

DEPRECATED. A list containing emails and group ids that have access to the folder

Example: ["[email protected]","ca45f483-db07-41e1-ab9a-1c610614416b"]
or
nullOptional
user_id_access_listany ofOptional
string · uuid[]Optional

A list containing user ids that have access to the folder

Example: ["ca45f483-db07-41e1-ab9a-1c610614416b","ca45f483-db07-41e1-ab9a-1c610614416c"]
or
nullOptional
group_id_access_listany ofOptional
string · uuid[]Optional

A list containing group ids that have access to the folder

Example: ["ca45f483-db07-41e1-ab9a-1c610614416b","ca45f483-db07-41e1-ab9a-1c610614416c"]
or
nullOptional
Responses
200

Successful Response

application/json
patch
/folders/{folder_id}
PATCH /folders/{folder_id} HTTP/1.1
Host: api.stack-ai.com
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 223

{
  "name": "folder1",
  "user_id_access_list": [
    "ca45f483-db07-41e1-ab9a-1c610614416b",
    "ca45f483-db07-41e1-ab9a-1c610614416c"
  ],
  "group_id_access_list": [
    "ca45f483-db07-41e1-ab9a-1c610614416b",
    "ca45f483-db07-41e1-ab9a-1c610614416c"
  ]
}
{
  "id": "ca45f483-db07-41e1-ab9a-1c610614416a",
  "name": "folder1",
  "user_id_access_list": [
    "ca45f483-db07-41e1-ab9a-1c610614416b",
    "ca45f483-db07-41e1-ab9a-1c610614416c"
  ],
  "group_id_access_list": [
    "ca45f483-db07-41e1-ab9a-1c610614416b",
    "ca45f483-db07-41e1-ab9a-1c610614416c"
  ],
  "personal_folder_owner_id": "ca45f483-db07-41e1-ab9a-1c610614416a"
}

Query Folders

post

Get all folders for the current user organization.

Args: offset (int): The offset of the folders to return as a number of rows. Defaults to 0. limit (int): The limit of the folders to return as a number of rows. Defaults to 100. query (str): The search query to filter folders by name. If provided, only folders whose names contain the query string will be returned.

Authorizations
OAuth2passwordRequired
Token URL:
Body

Query parameters for folder retrieval.

Args: offset (int): The offset of the folders to return as a number of rows. Defaults to 0. limit (int): The limit of the folders to return as a number of rows. Defaults to 100. query (str): The search query to filter folders by name. If provided, only folders whose names contain the query string will be returned. include_public_folders (bool): Whether to include public folders in the results. Defaults to True. include_personal_folders (bool): Whether to include personal folders in the results. Defaults to False. include_empty_folders (bool): Whether to include empty folders in the results. Defaults to False.

offsetintegerOptionalDefault: 0
limitany ofOptionalDefault: 100
integerOptional
or
nullOptional
queryany ofOptional
stringOptional
or
nullOptional
include_public_foldersbooleanOptionalDefault: true
include_private_foldersbooleanOptionalDefault: true
include_personal_foldersbooleanOptionalDefault: false
include_empty_foldersbooleanOptionalDefault: false
Responses
200

Successful Response

application/json
post
/folders
POST /folders HTTP/1.1
Host: api.stack-ai.com
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 163

{
  "offset": 0,
  "limit": 100,
  "query": "text",
  "include_public_folders": true,
  "include_private_folders": true,
  "include_personal_folders": false,
  "include_empty_folders": false
}
[
  {
    "id": "ca45f483-db07-41e1-ab9a-1c610614416a",
    "name": "folder1",
    "user_id_access_list": [
      "ca45f483-db07-41e1-ab9a-1c610614416b",
      "ca45f483-db07-41e1-ab9a-1c610614416c"
    ],
    "group_id_access_list": [
      "ca45f483-db07-41e1-ab9a-1c610614416b",
      "ca45f483-db07-41e1-ab9a-1c610614416c"
    ],
    "personal_folder_owner_id": "ca45f483-db07-41e1-ab9a-1c610614416a"
  }
]

Create Folder

put

Create a new folder in the current organization.

Authorizations
OAuth2passwordRequired
Token URL:
Body
namestringRequired
accessstring[]OptionalDeprecated

DEPRECATED field, kept for backward compatibility

user_id_access_liststring · uuid[]Optional

User ids of users who have access to the folder

group_id_access_liststring · uuid[]Optional

Group ids of users who have access to the folder

Responses
put
/folders
PUT /folders HTTP/1.1
Host: api.stack-ai.com
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 142

{
  "name": "text",
  "user_id_access_list": [
    "123e4567-e89b-12d3-a456-426614174000"
  ],
  "group_id_access_list": [
    "123e4567-e89b-12d3-a456-426614174000"
  ]
}
{
  "id": "ca45f483-db07-41e1-ab9a-1c610614416a",
  "name": "folder1",
  "user_id_access_list": [
    "ca45f483-db07-41e1-ab9a-1c610614416b",
    "ca45f483-db07-41e1-ab9a-1c610614416c"
  ],
  "group_id_access_list": [
    "ca45f483-db07-41e1-ab9a-1c610614416b",
    "ca45f483-db07-41e1-ab9a-1c610614416c"
  ],
  "personal_folder_owner_id": "ca45f483-db07-41e1-ab9a-1c610614416a"
}

Last updated

Was this helpful?