curl --request POST \
--url https://api.lighton.ai/api/v2/companies/{id}/workspaces/create/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>"
}
'import requests
url = "https://api.lighton.ai/api/v2/companies/{id}/workspaces/create/"
payload = {
"name": "<string>",
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', description: '<string>'})
};
fetch('https://api.lighton.ai/api/v2/companies/{id}/workspaces/create/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": 123,
"name": "<string>",
"workspace_type": "<string>",
"document_upload_method": "<string>",
"description": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"summaries": [
{
"language": "<string>",
"summary": "<string>"
}
],
"user_role": "<string>",
"collection": {
"id": 123,
"name": "<string>"
}
}Create a workspace
This endpoint allows you to create a workspace within a specific company.
This is useful for organizing and managing different projects or groups within the company.
It is restricted to admin and company admin users.
curl --request POST \
--url https://api.lighton.ai/api/v2/companies/{id}/workspaces/create/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>"
}
'import requests
url = "https://api.lighton.ai/api/v2/companies/{id}/workspaces/create/"
payload = {
"name": "<string>",
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', description: '<string>'})
};
fetch('https://api.lighton.ai/api/v2/companies/{id}/workspaces/create/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": 123,
"name": "<string>",
"workspace_type": "<string>",
"document_upload_method": "<string>",
"description": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"summaries": [
{
"language": "<string>",
"summary": "<string>"
}
],
"user_role": "<string>",
"collection": {
"id": 123,
"name": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The unique identifier of the company.
Body
V2 API: Uses flat structure with separate members and groups fields
Response
Mixin providing get_membership_role method for workspace serializers.
Show child attributes
Show child attributes
Return the user's highest role in the workspace (owner, editor, viewer) or None if not a member.
When a user is a member of the workspace through multiple groups (e.g., their private group and a company group), this returns the highest role among all their memberships. Role hierarchy: owner > editor > viewer
Show child attributes
Show child attributes