Workspace
Here you can find information about all API commands and queries related to workspaces.
Queries
get_workspace
Get workspace details.
Parameters
id(required): The ID of the workspace.
Example
curl -X POST 'https://app.polyteia.com/api' \
-header "Content-Type: application/json" \
-header "Authorization: Bearer <your_access_token>" \
--data '{
"query": "get_workspace",
"params": {
"id": "ws_cv33u4n0i6q45p93i930"
}
}'Workspace Response
id: The ID of the workspace.organization_id: The ID of the organization workspace belongs to.created_at: The date and time when the workspace was created.updated_at: The date and time when the workspace was last updated.name: The name of the workspace.description: The description of the workspace.attributes: Any optional key value pairs associated with the workspace.
Example Response
{
"data": {
"id": "ws_cv33u4n0i6q45p93i930",
"organization_id": "org_cv33u4n0i6q45p93i930",
"created_at": "2025-03-24T15:12:49.186202Z",
"updated_at": "2025-03-24T20:01:59.408382Z",
"name": "Finance",
"description": "Finance department workspace",
"attributes": {
"key": "value"
}
}
}list_workspaces
Paginated list of all workspaces subject to the user's access rights.
Parameters
page(required): The page number to return.minimum: 1size(required): The number of items to return per page.minimum: 1, maximum: 100
Example
curl -X POST 'https://app.polyteia.com/api' \
-header "Content-Type: application/json" \
-header "Authorization: Bearer <your_access_token>" \
--data '{
"query": "list_workspaces",
"params": {
"page": 1,
"size": 10
}
}'Response
total: The total number of workspaces subject to the user's access rights.page: The current page number.size: The number of items requested per page.items: An array of workspaces. See Workspace Response for more details.
Example Response
{
"data": {
"total": 1,
"page": 1,
"size": 100,
"items": [
{
"id": "ws_cv33u4n0i6q45p93i930",
"organization_id": "org_cv33u4n0i6q45p93i930",
"created_at": "2025-03-24T15:12:49.186202Z",
"updated_at": "2025-03-24T20:01:59.408382Z",
"name": "Finance",
"description": "Finance department workspace"
}
]
}
}Commands
create_workspace
Use this command to create a new workspace.
Parameters
organization_id(required): The ID of the organization to create the workspace in.name(required): Name of the workspace.minimum: 1maximum: 50unicode characters onlydescription(optional): Description of the workspace.maximum: 255unicode characters onlyattributes(optional): Any optional key value pairs to be associated with the workspace.
Example
curl -X POST 'https://app.polyteia.com/api' \
-header "Content-Type: application/json" \
-header "Authorization: Bearer <your_access_token>" \
--data '{
"query": "create_workspace",
"params": {
"organization_id": "org_cv33u4n0i6q45p93i930",
"name": "Finance",
"description": "Finance department workspace",
"attributes": {
"key1": "value1",
"key2": 100,
"key3": {
"nested": true
}
}
}
}'Response
The response is the Workspace Response of the created workspace.
Example Response
{
"data": {
"id": "ws_cv33u4n0i6q45p93i930",
"organization_id": "org_cv33u4n0i6q45p93i930",
"created_at": "2025-03-24T15:12:49.186202Z",
"updated_at": "2025-03-24T20:01:59.408382Z",
"name": "Finance",
"description": "Finance department workspace",
"attributes": {
"key": "value"
}
}
}Ensure to store the id for future reference or updates to the workspace.
update_workspace
Use this command to update a workspace.
Parameters
id(required): The ID of the workspace to update.name(required): The name of the workspace.description(optional): The description of the workspace.attributes(optional): A JSON object of key-value pairs to add to the workspace.
Example
curl -X POST 'https://app.polyteia.com/api' \
-header "Content-Type: application/json" \
-header "Authorization: Bearer <your_access_token>" \
--data '{
"query": "update_workspace",
"params": {
"id": "ws_cv33u4n0i6q45p93i930",
"name": "My Workspace",
"description": "My Workspace Description",
"attributes": {
"key": "new_value"
}
}
}'Response
The response is the Workspace Response of the updated workspace.
Example Response
{
"data": {
"id": "ws_cv33u4n0i6q45p93i930",
"organization_id": "org_cv33u4n0i6q45p93i930",
"created_at": "2025-03-24T15:12:49.186202Z",
"updated_at": "2025-03-24T20:01:59.408382Z",
"name": "My Workspace",
"description": "My Workspace Description",
"attributes": {
"key": "new_value"
}
}
}delete_workspace
Use this command to delete a workspace.
This action is irreversible. Use this command with caution.
Parameters
id(required): The ID of the workspace to delete.
Example
curl -X POST 'https://app.polyteia.com/api' \
-header "Content-Type: application/json" \
-header "Authorization: Bearer <your_access_token>" \
--data '{
"query": "delete_workspace",
"params": {
"id": "ws_cv33u4n0i6q45p93i930"
}
}'Response
{
"data": {
"id": "ws_cv33u4n0i6q45p93i930"
}
}id: The ID of the workspace that was deleted.
Zuletzt aktualisiert
War das hilfreich?