> For the complete documentation index, see [llms.txt](https://publer.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://publer.com/docs/api-reference/workspaces.md).

# Workspaces

Manage organizational units (“workspaces”) that group social accounts, members, and content. Workspaces help agencies, brands, and departments keep clients and campaigns separate under a single Publer login.

### Requirements

* **Authentication**: Bearer API token
* **Scope**: `workspaces`
* **Headers**:
  * `Authorization: Bearer-API YOUR_API_KEY`

### Endpoint

#### List Workspaces

Retrieve all workspaces accessible by the authenticated user.

```http
GET /api/v1/workspaces
```

## List Workspaces

> Retrieves a list of all workspaces that the authenticated user has access to.

```json
{"openapi":"3.1.1","info":{"title":"Publer API","version":"1.0.0"},"tags":[{"name":"Workspaces","description":"Endpoints for managing workspaces and teams"}],"servers":[{"url":"https://app.publer.com/api/v1"}],"security":[{"BearerApiAuth":[]}],"components":{"securitySchemes":{"BearerApiAuth":{"type":"apiKey","name":"Authorization","in":"header","description":"API key authentication. Format: \"Bearer-API YOUR_API_KEY\""}},"schemas":{"Workspace":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the workspace"},"owner":{"type":"object","description":"Information about the workspace owner","properties":{"id":{"type":"string","description":"Unique identifier for the owner"},"email":{"type":"string","description":"Email address of the owner"},"name":{"type":"string","description":"Username of the owner"},"first_name":{"type":"string","description":"First name of the owner"},"picture":{"type":"string","description":"URL to the owner's profile picture"}}},"name":{"type":"string","description":"The workspace's display name"},"members":{"type":"array","description":"List of users with access to the workspace","items":{"type":"object"}},"plan":{"type":"string","description":"Subscription plan of the workspace"},"picture":{"type":"string","description":"URL to the workspace's logo"}}},"401ErrorResponse":{"type":"object","properties":{"errors":{"type":"array","description":"List of error messages","items":{"type":"string"}}}},"403ErrorResponse":{"type":"object","properties":{"errors":{"type":"array","description":"List of error messages","items":{"type":"string"}}}}}},"paths":{"/workspaces":{"get":{"summary":"List Workspaces","description":"Retrieves a list of all workspaces that the authenticated user has access to.","tags":["Workspaces"],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Workspace"}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/401ErrorResponse"}}}},"403":{"description":"Permission denied or missing required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/403ErrorResponse"}}}}}}}}}
```

### Working with Workspaces

* A user can belong to multiple workspaces.
* Each workspace has its own accounts, posts, and settings.
* Use the workspace context (`Publer-Workspace-Id` header) to target API calls at the correct workspace.

### Workspace Context for Other Endpoints

Many endpoints require you to specify which workspace you’re operating in. Include the `Publer-Workspace-Id` header:

```bash
curl -X GET https://app.publer.com/api/v1/accounts \
  -H "Authorization: Bearer-API YOUR_API_KEY" \
  -H "Publer-Workspace-Id: 61a7c2e4f9e8c3b2d1e0f9a8"
```

### Get Workspace

Retrieves a single workspace the authenticated user has access to.

```http
GET /api/v1/workspaces/{id}
```

## Get Workspace

> Retrieves a single workspace the authenticated user has access to.

```json
{"openapi":"3.1.1","info":{"title":"Publer API","version":"1.0.0"},"tags":[{"name":"Workspaces","description":"Endpoints for managing workspaces and teams"}],"servers":[{"url":"https://app.publer.com/api/v1"}],"security":[{"BearerApiAuth":[]}],"components":{"securitySchemes":{"BearerApiAuth":{"type":"apiKey","name":"Authorization","in":"header","description":"API key authentication. Format: \"Bearer-API YOUR_API_KEY\""}},"schemas":{"Workspace":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the workspace"},"owner":{"type":"object","description":"Information about the workspace owner","properties":{"id":{"type":"string","description":"Unique identifier for the owner"},"email":{"type":"string","description":"Email address of the owner"},"name":{"type":"string","description":"Username of the owner"},"first_name":{"type":"string","description":"First name of the owner"},"picture":{"type":"string","description":"URL to the owner's profile picture"}}},"name":{"type":"string","description":"The workspace's display name"},"members":{"type":"array","description":"List of users with access to the workspace","items":{"type":"object"}},"plan":{"type":"string","description":"Subscription plan of the workspace"},"picture":{"type":"string","description":"URL to the workspace's logo"}}},"401ErrorResponse":{"type":"object","properties":{"errors":{"type":"array","description":"List of error messages","items":{"type":"string"}}}},"403ErrorResponse":{"type":"object","properties":{"errors":{"type":"array","description":"List of error messages","items":{"type":"string"}}}}}},"paths":{"/workspaces/{id}":{"get":{"summary":"Get Workspace","tags":["Workspaces"],"description":"Retrieves a single workspace the authenticated user has access to.","parameters":[{"schema":{"type":"string"},"name":"id","in":"path","required":true,"description":"ID of the workspace"}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspace"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/401ErrorResponse"}}}},"403":{"description":"Forbidden - the workspace does not belong to this user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/403ErrorResponse"}}}}}}}}}
```

{% hint style="info" %}
Like `GET /api/v1/workspaces`, this endpoint does not require the `Publer-Workspace-Id` header — the workspace is identified by the path. A workspace the user cannot access returns **403**.
{% endhint %}

### Related Resources

* [Users API](/docs/api-reference/users.md) - Access user profile information
* [Accounts API](/docs/api-reference/accounts.md) - Access social accounts within workspaces
* [Posts API](/docs/posting/create-posts.md) — Create, schedule, and manage content


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://publer.com/docs/api-reference/workspaces.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
