> This page is for Trading.

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

# Get a workspace

GET https://api.immix.xyz/v1/workspaces/{workspaceId}

One workspace by id: any row you can see, `owned` saying whether it is yours. Your own rows now; a colleague's `ORG` workspace of your organisation once organisation admission exists, and from then 503 `NOT_PRIMED` for an id you do not own while admission is not primed. Anything else is 404, never 403. The `ETag` is the version; `If-None-Match` is answered 304 while it holds.

**Answers `304`.** Unchanged: the version `If-None-Match` named is the row's. No body; the `ETag` restates the version.

| Response header | Description                                                                                                                                                                |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ETag`          | The row's version, quoted: `"<version>"`, what `If-Match` takes on a write of the row.                                                                                     |
| `X-Request-Id`  | The request's id: your `X-Request-Id` where you sent a usable one, a fresh id otherwise. An error restates it as `error.requestId`; quote it when you ask about a request. |

Reference: https://docs.immix.xyz/trading/api-reference/rest-api/workspaces/get

## Authentication

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

## Request

### Path parameters

- `workspaceId` (string, required) — The workspace id.

### Headers

- `If-None-Match` (string, optional) — The `ETag` you hold, quoted or bare: while it is still the row's version the read answers 304 with no body, else 200 with the row.
- `X-Request-Id` (string, optional) — Your own id for the request: 8 to 128 of `[A-Za-z0-9._-]`. It becomes the request's id and is echoed on the response. A value off that grammar is replaced with a fresh id, never refused.

## Response

### 200

The workspace.

- `workspaceId` (string, required) — The workspace's id, a UUID. Ids are opaque strings.
- `slug` (string, required) — The slug, 1 to 100 characters of `[a-z0-9-]`, unique among the owner's workspaces: minted from the title on create unless you supplied one, and never changed after, so a page URL outlives a rename.
- `title` (string, required) — The title, 1 to 100 characters, not blank, with no NUL and no unpaired surrogate.
- `layout` (map from string to any, required) — The layout: a JSON object whose shape belongs to the code that renders it (keep your own `schemaVersion` inside it). The API checks that it is an object of at most 256 KiB serialised and never reads inside it; it is served as you last wrote it: the same tree, members in their order, numbers exact.
- `tags` (list of string, required) — Tags to list by: at most 50, each 1 to 64 characters of `[a-z0-9:._-]`, lower-cased on write and unique.
- `visibility` (string, required) — Who may read the row: `PRIVATE`, its owner alone; `ORG`, the owner's organisation too, read-only, once organisation admission serves colleagues' rows. `ORG` needs a token that names an organisation: without one it is 400. Append-only: tolerate values you don't know; a write of one this release does not know is 400.
- `owned` (boolean, required) — Whether you own the row. `false` for a colleague's `ORG` workspace, which you can read but not write. The owner's identity is not on the row.
- `version` (string, required) — The row's version, the `ETag`'s value: send it as `If-Match` on a write. A decimal string from one sequence shared by every row.
- `createdAtNs` (string, required) — When the workspace was created, in epoch nanoseconds; microsecond-exact, so it ends in `000`.
- `updatedAtNs` (string, required) — When the workspace was last written, in epoch nanoseconds; microsecond-exact, so it ends in `000`.

## Errors

### 400 Get Workspaces Request Bad Request Error

The request is malformed.

- `error` (ErrorBody, required)
- `currentVersion` (string, optional) — On a 412 `VERSION_CONFLICT` from a conditional write that met a row: the row's current version (the `ETag` carries the same token); re-read, reapply, retry. Absent from every other response, a 412 for a row that no longer exists included.

### 401 Get Workspaces Request Unauthorized Error

The bearer token is missing or not valid.

- `error` (ErrorBody, required)
- `currentVersion` (string, optional) — On a 412 `VERSION_CONFLICT` from a conditional write that met a row: the row's current version (the `ETag` carries the same token); re-read, reapply, retry. Absent from every other response, a 412 for a row that no longer exists included.

### 404 Get Workspaces Request Not Found Error

No workspace you can see has this id, whatever its shape.

- `error` (ErrorBody, required)
- `currentVersion` (string, optional) — On a 412 `VERSION_CONFLICT` from a conditional write that met a row: the row's current version (the `ETag` carries the same token); re-read, reapply, retry. Absent from every other response, a 412 for a row that no longer exists included.

### 501 Get Workspaces Request Not Implemented Error

`NOT_IMPLEMENTED`: this deployment runs no user-state store, so it serves no workspaces.

- `error` (ErrorBody, required)
- `currentVersion` (string, optional) — On a 412 `VERSION_CONFLICT` from a conditional write that met a row: the row's current version (the `ETag` carries the same token); re-read, reapply, retry. Absent from every other response, a 412 for a row that no longer exists included.

### 503 Get Workspaces Request Service Unavailable Error

`NOT_PRIMED`: for an id you do not own, once organisation admission exists and while it is not primed; your own rows are unaffected. `USER_STATE_UNAVAILABLE`: your workspaces cannot be read or written now; retry. `USER_STATE_SCHEMA_BEHIND`: the store is behind this release; a retry does not help until the deployment catches up.

- `error` (ErrorBody, required)
- `currentVersion` (string, optional) — On a 412 `VERSION_CONFLICT` from a conditional write that met a row: the row's current version (the `ETag` carries the same token); re-read, reapply, retry. Absent from every other response, a 412 for a row that no longer exists included.

## Types

### ErrorBody

- `code` (string, required) — Machine-readable, UPPER_SNAKE and append-only; tolerate codes you don't know. Branch on this, never on the message.
- `message` (string, required) — For display only; its wording may change at any time.
- `retryable` (boolean, required) — Whether sending the identical request again, after `Retry-After` or a short pause, can succeed with nothing else changed. `false` where something must change first: the request, the caller's standing, or the platform's own records or deployment.
- `requestId` (string, required) — The request's id, also sent as X-Request-Id; quote it to support.

## Examples

**Response**

```json
{
  "workspaceId": "0192f3a0-7c2e-7d1a-9b3f-4d5e6f708192",
  "slug": "trading",
  "title": "Trading",
  "layout": {
    "panels": [
      {
        "type": "chart",
        "w": 8
      },
      {
        "type": "order-book",
        "w": 4
      }
    ],
    "schemaVersion": 1
  },
  "tags": [
    "desk:rates",
    "page:trade"
  ],
  "visibility": "PRIVATE",
  "owned": true,
  "version": "7",
  "createdAtNs": "1761264000000000000",
  "updatedAtNs": "1761264000000000000"
}
```

**SDK Code**

```python
import requests

url = "https://api.immix.xyz/v1/workspaces/workspaceId"

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

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

print(response.json())
```

```javascript
const url = 'https://api.immix.xyz/v1/workspaces/workspaceId';
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.immix.xyz/v1/workspaces/workspaceId"

	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.immix.xyz/v1/workspaces/workspaceId")

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.immix.xyz/v1/workspaces/workspaceId")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.immix.xyz/v1/workspaces/workspaceId', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.immix.xyz/v1/workspaces/workspaceId");
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.immix.xyz/v1/workspaces/workspaceId")! 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()
```