Skip to main content
GET
/
api
/
v3
/
workspaces
List workspaces
curl --request GET \
  --url https://api.lighton.ai/api/v3/workspaces \
  --header 'Authorization: Bearer <token>'
import requests

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

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.lighton.ai/api/v3/workspaces', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

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

curl_close($curl);

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

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

func main() {

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

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

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

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

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.lighton.ai/api/v3/workspaces")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "count": 123,
  "results": [
    {
      "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,
      "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>"
        }
      ]
    }
  ],
  "next": "http://api.example.org/accounts/?page=4",
  "previous": "http://api.example.org/accounts/?page=2"
}

Authorizations

Authorization
string
header
required

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

Query Parameters

datasource_type
enum<string>

The type of data source.

  • servicenow - ServiceNow
  • googledrive - Google Drive
  • sharepoint - SharePoint
  • webscrapper - WebScrapper
Available options:
googledrive,
servicenow,
sharepoint,
webscrapper
document_upload_method
enum<string>

Method for adding documents to this workspace: manual uploads or synced from datasources

  • manual - Manual
  • synced - Synced
Available options:
manual,
synced
group_id
integer
group_name
string
name
string
page
integer

A page number within the paginated result set.

page_size
integer

Number of results to return per page.

user_role
enum<string>
  • owner - Owner
  • editor - Editor
  • viewer - Viewer
Available options:
editor,
owner,
viewer
workspace_type
enum<string>
  • shared - Shared
  • personal - Personal
Available options:
personal,
shared

Response

List of workspaces where the user is a member

count
integer
required
Example:

123

results
object[]
required
next
string<uri> | null
Example:

"http://api.example.org/accounts/?page=4"

previous
string<uri> | null
Example:

"http://api.example.org/accounts/?page=2"