> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.awork.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.awork.com/_mcp/server.

# Returns the specified document space.

GET https://api.awork.com/api/v1/documentspaces/{documentSpaceId}

Returns the specified document space when it is visible to the current user.
The user must have at least `read` permission for the specified document space.

Reference: https://developers.awork.com/apiv1/document-spaces/get-document-space-by-id

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `documentSpaceId` (string, required) — The id of the document space to retrieve.

## Response

### 200

OK

- `id` (string, optional) — The id of the entity.
- `createdOn` (string, optional) — The date this entity was created.
- `createdBy` (string, optional) — The id of the user who created this entity.
- `updatedOn` (string, optional) — The date this entity was last modified.
- `updatedBy` (string, optional) — The id of the user who last modified this entity.
- `name` (string, optional, nullable) — The name of the document.
- `currentDocumentVersionId` (string, optional, nullable) — The id of the current document version.
- `documentSpaceId` (string, optional, nullable) — The id of the document space.
- `documentSpace` (DocumentSpaceModel, optional)
- `parentId` (string, optional, nullable) — The id of the document's parent document.
- `projectId` (string, optional, nullable) — The id of the project this document references.
- `project` (PermissionProject, optional)
- `taskId` (string, optional, nullable) — The id of the task this document references.
- `emoji` (string, optional, nullable) — The emoji of the document.
- `isPrivate` (boolean, optional) — Whether the document is private.
- `order` (double, optional, nullable) — The order of the document in either the list of private docs, the referenced document space or in the referenced project.
- `isExternal` (boolean, optional) — Whether the document belongs to an external project.
- `isHiddenForConnectUsers` (boolean, optional) — Whether the document is hidden for connect users.
- `contributors` (list of DocumentContributorModel, optional, nullable) — The contributors of this document.
- `teams` (list of DocumentToTeamModel, optional, nullable) — The teams this document is connected to.
- `workspaceAccessLevel` (string, optional, nullable) — Determines the level of access to this document granted to all workspace users. Can be either not set (no access), `read`, or `manage`.
- `inheritedWorkspaceAccessFromDocumentId` (string, optional, nullable) — The id of the document the workspace access level permission has been inherited from.
- `inheritedWorkspaceAccessFromDocument` (PermissionInheritedWorkspaceAccessFromDocument, optional)
- `movedToTrashOn` (string, optional, nullable) — The date the document has been moved to the trash
- `movedToTrashBy` (string, optional, nullable) — The id of the user that moved the document to the trash.
- `rootDocumentCreatedBy` (string, optional) — The user id of the creator of the root document of this document's document tree.

## Errors

### 401 Unauthorized Error

Unauthorized

- `code` (string, required) — The error code.
- `description` (string, required) — The description of the error.
- `link` (string, required) — The link to the API documentation page.
- `details` (list of string, optional, nullable) — A list of details describing the error.
- `validationErrors` (list of ValidationErrorResponse, optional, nullable) — If a validation error occurred, this contains the validation errors for each property.
- `traceId` (string, optional, nullable) — The request trace id for tracking the request.

### 404 Not Found Error

Not Found

- `code` (string, required) — The error code.
- `description` (string, required) — The description of the error.
- `link` (string, required) — The link to the API documentation page.
- `details` (list of string, optional, nullable) — A list of details describing the error.
- `validationErrors` (list of ValidationErrorResponse, optional, nullable) — If a validation error occurred, this contains the validation errors for each property.
- `traceId` (string, optional, nullable) — The request trace id for tracking the request.

## Types

### DocumentSpaceModel

- `id` (string, optional) — The id of the entity.
- `createdOn` (string, optional) — The date this entity was created.
- `createdBy` (string, optional) — The id of the user who created this entity.
- `updatedOn` (string, optional) — The date this entity was last modified.
- `updatedBy` (string, optional) — The id of the user who last modified this entity.
- `name` (string, optional, nullable) — The name of the document space.
- `isExternal` (boolean, optional) — Whether this document space is coming from an external workspace (awork Connect).
- `emoji` (string, optional, nullable) — The emoji of the document space.
- `color` (string, optional, nullable) — The color of the document space for display purposes in the app. Can be null when no color assigned.
- `order` (double, optional, nullable) — The order of the document space in the list of document spaces.
- `workspaceAccessLevel` (string, optional, nullable) — Determines the level of access to this document space granted to all workspace users. Can be either not set (no access), `read`, or `manage`.
- `contributors` (list of ContributorModel, optional, nullable) — The contributors of this document space.
- `teams` (list of EntityToTeamModel, optional, nullable) — The teams this document space is connected to.

### PermissionProject

- `id` (string, optional)
- `name` (string, optional, nullable)
- `createdBy` (string, optional)
- `teams` (list of PermissionTeam, optional, nullable)
- `members` (list of PermissionProjectMember, optional, nullable)
- `isPrivate` (boolean, optional)
- `isExternal` (boolean, optional)

### DocumentContributorModel

- `id` (string, optional) — The id of the contributor.
- `userId` (string, optional) — The id of the user this contributor references.
- `accessLevel` (string, optional, nullable) — Determines the level of access granted to this contributor with respect to the specific entity. Can be either set to `read` or `manage`.
- `firstName` (string, optional, nullable) — The first name of the user.
- `lastName` (string, optional, nullable) — The last name of the user.
- `hasImage` (boolean, optional, nullable) — Whether the user has an image.
- `isDeactivated` (boolean, optional) — Whether the user is deactivated.
- `documentId` (string, optional) — The id of the referenced document.
- `inheritedFromDocumentContributorId` (string, optional, nullable) — The id of the contributor the permission has been inherited from.
- `inheritedDocumentContributor` (PermissionInheritedDocumentContributor, optional)

### DocumentToTeamModel

- `id` (string, optional) — The id of the entity to team.
- `teamId` (string, optional) — The id of the team this entity to team references.
- `accessLevel` (string, optional, nullable) — Determines the level of access granted to this entity to team with respect to the specific entity. Can be either set to `read` or `manage`.
- `name` (string, optional, nullable) — The name of the team.
- `icon` (string, optional, nullable) — The icon which is assigned to the team.
- `color` (string, optional, nullable) — The color of the team.
- `documentId` (string, optional) — The id of the referenced document.
- `inheritedFromDocumentToTeamId` (string, optional, nullable) — The id of the document to team the permission has been inherited from.
- `inheritedDocumentToTeam` (PermissionInheritedDocumentToTeam, optional)

### PermissionInheritedWorkspaceAccessFromDocument

- `workspaceAccessLevel` (string, optional, nullable)

### ValidationErrorResponse

The validation error response.

- `property` (string, optional, nullable) — The name of the property that failed validation.
- `message` (string, optional, nullable) — The reason why this property failed validation.

### ContributorModel

- `id` (string, optional) — The id of the contributor.
- `userId` (string, optional) — The id of the user this contributor references.
- `accessLevel` (string, optional, nullable) — Determines the level of access granted to this contributor with respect to the specific entity. Can be either set to `read` or `manage`.
- `firstName` (string, optional, nullable) — The first name of the user.
- `lastName` (string, optional, nullable) — The last name of the user.
- `hasImage` (boolean, optional, nullable) — Whether the user has an image.
- `isDeactivated` (boolean, optional) — Whether the user is deactivated.

### EntityToTeamModel

- `id` (string, optional) — The id of the entity to team.
- `teamId` (string, optional) — The id of the team this entity to team references.
- `accessLevel` (string, optional, nullable) — Determines the level of access granted to this entity to team with respect to the specific entity. Can be either set to `read` or `manage`.
- `name` (string, optional, nullable) — The name of the team.
- `icon` (string, optional, nullable) — The icon which is assigned to the team.
- `color` (string, optional, nullable) — The color of the team.

### PermissionTeam

- `id` (string, optional)
- `name` (string, optional, nullable)

### PermissionProjectMember

- `id` (string, optional)
- `projectRoleId` (string, optional)
- `userId` (string, optional)

### PermissionInheritedDocumentContributor

- `documentId` (string, optional)
- `accessLevel` (string, optional, nullable)

### PermissionInheritedDocumentToTeam

- `documentId` (string, optional)
- `accessLevel` (string, optional, nullable)

## Examples

**Response**

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "createdOn": "2022-03-11T15:33:47.100Z",
  "createdBy": "123e4567-e89b-12d3-a456-426614174000",
  "updatedOn": "2022-03-11T21:15:00.100Z",
  "updatedBy": "123e4567-e89b-12d3-a456-426614174000",
  "name": "string",
  "currentDocumentVersionId": "123e4567-e89b-12d3-a456-426614174000",
  "documentSpaceId": "123e4567-e89b-12d3-a456-426614174000",
  "documentSpace": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "createdOn": "2022-03-11T15:33:47.100Z",
    "createdBy": "123e4567-e89b-12d3-a456-426614174000",
    "updatedOn": "2022-03-11T21:15:00.100Z",
    "updatedBy": "123e4567-e89b-12d3-a456-426614174000",
    "name": "string",
    "isExternal": true,
    "emoji": "string",
    "color": "purple",
    "order": 1.1,
    "workspaceAccessLevel": "string",
    "contributors": [
      {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "userId": "123e4567-e89b-12d3-a456-426614174000",
        "accessLevel": "string",
        "firstName": "Lisa",
        "lastName": "Smith",
        "hasImage": true,
        "isDeactivated": false
      }
    ],
    "teams": [
      {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "teamId": "123e4567-e89b-12d3-a456-426614174000",
        "accessLevel": "string",
        "name": "Designers",
        "icon": "paintbrush",
        "color": "purple"
      }
    ]
  },
  "parentId": "123e4567-e89b-12d3-a456-426614174000",
  "projectId": "123e4567-e89b-12d3-a456-426614174000",
  "project": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "name": "string",
    "createdBy": "123e4567-e89b-12d3-a456-426614174000",
    "teams": [
      {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "name": "string"
      }
    ],
    "members": [
      {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "projectRoleId": "123e4567-e89b-12d3-a456-426614174000",
        "userId": "123e4567-e89b-12d3-a456-426614174000"
      }
    ],
    "isPrivate": true,
    "isExternal": true
  },
  "taskId": "123e4567-e89b-12d3-a456-426614174000",
  "emoji": "string",
  "isPrivate": true,
  "order": 1.1,
  "isExternal": true,
  "isHiddenForConnectUsers": true,
  "contributors": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "userId": "123e4567-e89b-12d3-a456-426614174000",
      "accessLevel": "string",
      "firstName": "Lisa",
      "lastName": "Smith",
      "hasImage": true,
      "isDeactivated": false,
      "documentId": "123e4567-e89b-12d3-a456-426614174000",
      "inheritedFromDocumentContributorId": "123e4567-e89b-12d3-a456-426614174000",
      "inheritedDocumentContributor": {
        "documentId": "123e4567-e89b-12d3-a456-426614174000",
        "accessLevel": "string"
      }
    }
  ],
  "teams": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "teamId": "123e4567-e89b-12d3-a456-426614174000",
      "accessLevel": "string",
      "name": "Designers",
      "icon": "paintbrush",
      "color": "purple",
      "documentId": "123e4567-e89b-12d3-a456-426614174000",
      "inheritedFromDocumentToTeamId": "123e4567-e89b-12d3-a456-426614174000",
      "inheritedDocumentToTeam": {
        "documentId": "123e4567-e89b-12d3-a456-426614174000",
        "accessLevel": "string"
      }
    }
  ],
  "workspaceAccessLevel": "string",
  "inheritedWorkspaceAccessFromDocumentId": "123e4567-e89b-12d3-a456-426614174000",
  "inheritedWorkspaceAccessFromDocument": {
    "workspaceAccessLevel": "string"
  },
  "movedToTrashOn": "2024-01-15T09:30:00Z",
  "movedToTrashBy": "123e4567-e89b-12d3-a456-426614174000",
  "rootDocumentCreatedBy": "123e4567-e89b-12d3-a456-426614174000"
}
```

**SDK Code**

```python
import requests

url = "https://api.awork.com/api/v1/documentspaces/documentSpaceId"

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

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

print(response.json())
```

```javascript
const url = 'https://api.awork.com/api/v1/documentspaces/documentSpaceId';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

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

func main() {

	url := "https://api.awork.com/api/v1/documentspaces/documentSpaceId"

	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(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.awork.com/api/v1/documentspaces/documentSpaceId")

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
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.awork.com/api/v1/documentspaces/documentSpaceId")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.awork.com/api/v1/documentspaces/documentSpaceId', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.awork.com/api/v1/documentspaces/documentSpaceId");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.awork.com/api/v1/documentspaces/documentSpaceId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```