Skip to main content
PATCH
/
api
/
v3
/
workspaces
/
{id}
Update a workspace
curl --request PATCH \
  --url https://api.lighton.ai/api/v3/workspaces/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "members": "<unknown>"
}
'
import requests

url = "https://api.lighton.ai/api/v3/workspaces/{id}"

payload = {
"name": "<string>",
"description": "<string>",
"members": "<unknown>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', description: '<string>', members: '<unknown>'})
};

fetch('https://api.lighton.ai/api/v3/workspaces/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lighton.ai/api/v3/workspaces/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'members' => '<unknown>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.lighton.ai/api/v3/workspaces/{id}"

payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"members\": \"<unknown>\"\n}")

req, _ := http.NewRequest("PATCH", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.patch("https://api.lighton.ai/api/v3/workspaces/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"members\": \"<unknown>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.lighton.ai/api/v3/workspaces/{id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"members\": \"<unknown>\"\n}"

response = http.request(request)
puts response.read_body
{
  "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",
  "files_count": 123,
  "used_storage": 123,
  "summaries": [
    {
      "language": "<string>",
      "summary": "<string>"
    }
  ],
  "sync": {
    "datasource_type": "<string>",
    "source_name": "<string>",
    "last_status": "<string>",
    "updated_at": "2023-11-07T05:31:56Z",
    "failed_files_count": 123,
    "next_import_date": "2023-11-07T05:31:56Z",
    "editable": true,
    "name": "<string>",
    "instance_url": "<string>",
    "tenant_id": "<string>",
    "site_name": "<string>",
    "client_id": "<string>",
    "filter_criteria": "<unknown>"
  },
  "scoped_api_keys": [
    {
      "id": "<string>",
      "name": "<string>",
      "prefix": "<string>",
      "role": "<string>",
      "created_at": "2023-11-07T05:31:56Z",
      "created_by": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
integer
required

The unique identifier of the workspace.

Body

name
string

Workspace name (max 100 characters, cannot be empty). When sent together with deleted_at: null (restore), the workspace is restored under this name — used to resolve a collision when the original name was re-taken by a live workspace during the grace period.

description
string

Workspace description. Send empty string or null to clear. May be sent together with deleted_at: null (restore) to set the description as part of the restore request; a name collision rejects the whole request before the description is applied. members and datasource are not accepted on a restore request — restore first, then PATCH them.

members
any

Members with roles in format {"users": [{"id": <user_id>, "role": "owner|editor|viewer"}, ...], "groups": [{"id": <group_id>, "role": "owner|editor|viewer"}, ...]}. Role defaults to viewer if not specified. REPLACES all existing members.

datasource
object

Datasource configuration to convert this workspace into a read-only synced workspace. Workspace OWNER (or a role granting workspace edit/delete) only. Cannot be undone.

Response

Workspace updated successfully

V3 Response serializer for company workspace creation and retrieval.

id
integer
required
name
string
required
workspace_type
string
required
document_upload_method
string
required
description
string
required
created_at
string<date-time>
required
updated_at
string<date-time>
required
files_count
integer
required
user_role
required
  • owner - owner
  • editor - editor
  • viewer - viewer
  • `` -
Available options:
owner,
editor,
viewer
used_storage
number<double>
required
summaries
object[]
required
read-only
sync
object | null
required
scoped_api_keys
object[]
required
read-only