Spaces API
The Spaces API allows you to manage and retrieve spaces (workspaces/groups) in your Unpod platform. Spaces are containers that organize your tasks, runs, and data collections.Prerequisites: Make sure you have your API Token and Org-Handle ready. See Authentication for details.
Get All Spaces
Retrieve details of all created spaces, allowing you to view and manage workspace/group entities in the system.Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | API Key format: Token <token> |
| Org-Handle | string | Yes | Organization domain handle |
You can get the
Org-Handle by hitting the Get All Organizations API. The domain_handle field in the response is your Org-Handle.Example Request
Success Response (200)
Response Fields
| Field | Type | Description |
|---|---|---|
| count | integer | Total number of spaces |
| status_code | integer | HTTP status code |
| message | string | Response message |
| data | array | Array of space objects |
Space Object Fields
| Field | Type | Description |
|---|---|---|
| name | string | Space name |
| slug | string | URL-friendly unique identifier |
| token | string | Public token for API access |
| description | string | Space description |
| logo | string | Logo URL (null if not set) |
| privacy_type | string | Privacy setting: shared, private |
| space_type | string | Type of space: knowledge_base, etc. |
| content_type | string | Content type: table, etc. |
| organization | object | Organization details (name, domain_handle) |
Error Response (401 Unauthorized)
Get Space by Token
Retrieve configuration and metadata of a specific space identified by its token, allowing you to view its current setup and properties.Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| space_token | string | Yes | Public token identifying the space |
You can get the
space_token by hitting the Get All Spaces API. The token field in the response is your Space Token.Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | API Key format: Token <token> |
| Org-Handle | string | Yes | Organization domain handle |
You can get the
Org-Handle by hitting the Get All Organizations API. The domain_handle field in the response is your Org-Handle.Example Request
Success Response (200)
Response Fields
| Field | Type | Description |
|---|---|---|
| status_code | integer | HTTP status code |
| message | string | Response message |
| data | object | Space object details |
Error Response (401 Unauthorized)
Error Response (404 Not Found)
Common Error Codes
| Status Code | Description |
|---|---|
| 200 | Success - Request completed successfully |
| 400 | Bad Request - Invalid parameters provided |
| 401 | Unauthorized - Invalid or missing API token |
| 403 | Forbidden - Access denied to the resource |
| 404 | Not Found - Space or Organization not found |
| 500 | Internal Server Error - Server-side error |
Code Examples
Best Practices
- Org-Handle: Always include the correct organization handle in requests that require it
- Space Token: Use the space token for accessing specific space resources
- Error Handling: Always handle potential errors and edge cases
- Security: Keep API tokens secure and rotate them regularly
- Caching: Consider caching space/organization data to reduce API calls