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

# Get a single workspace

GET https://app.lucanto.eu/api/v1/user/workspaces/{workspace_id}

Returns the same shape as `listWorkspaces`, scoped to a single
workspace. Returns `404` (not `403`) when the user does not
belong to the requested workspace — this prevents leaking the
existence of workspaces the caller can't see.


Reference: https://docs.lucanto.eu/api-reference/api-reference/workspaces/get-workspace

## Authentication

- `Authorization` header (bearer token, required) — JWT issued via POST /api/v1/auth/sign_in. Used by mobile and SPA clients. Revoked tokens are rejected.
- `Authorization` header (bearer token, required) — Lucanto API key. Two prefixes: * `lct_pat_<random><checksum>` — personal access token (owner: User) * `lct_live_<random><checksum>` — workspace token, live data Issue keys at `/settings/api_keys` (personal) or `/:workspace_id/settings/api_keys` (workspace). Plaintext token is shown once and never again.

## Request

### Path parameters

- `workspace_id` (long, required) — Workspace ID. The numeric ID shown in your URLs.

## Response

### 200

OK

- `id` (long, required) — Workspace ID. Use this in all workspace-scoped paths.
- `time_zone` (string, required) — The workspace's time zone as an IANA identifier. Recurring documents are issued once this zone's calendar day reaches the schedule's next issue date, and recurring emails go out at the chosen hour *in this zone* — so a generator set to "morning" delivers at 08:00 here, not at 08:00 UTC. Defaults to `Europe/Bratislava`, derived from the workspace's registered country. Never null.
- `default` (boolean, required) — `true` if this is the user's default workspace. Exactly one workspace per user is the default at any time.
- `created_at` (datetime, required)
- `updated_at` (datetime, required)
- `display_name` (string, optional, nullable) — Private, in-app label for the workspace, shown in the workspace switcher to the workspace's OWN members (e.g. a short alias like "SC"). NOT shown to the workspace's customers — the official customer-facing name is `legal_identity.legal_name`. May be `null` when no label is set; clients building a picker fall back to `legal_identity.legal_name`.
- `accounting_type` (enum, optional, nullable) — The workspace's bookkeeping mode. Drives expense category options and tax/VAT logic. `simple` is single-entry bookkeeping; `double_entry` is full double-entry; and `flat_rate_expenses` is the SK/CZ "paušálne výdavky" simplified regime for sole proprietors. `null` when the workspace hasn't finished onboarding yet.
  - Allowed values: `simple`, `double_entry`, `flat_rate_expenses`
- `user_role` (enum, optional, nullable) — The caller's built-in role in this workspace. Stays populated even when a custom role is in effect — it is the coarse fallback role and is always one of the four built-ins. `null` only if the caller somehow has no membership.
  - Allowed values: `owner`, `executive_manager`, `accountant`, `employee`
- `permissions` (list of string, optional) — The caller's effective permission keys in this workspace, one strongest key per area in `"<area>:<level>"` form (e.g. `documents:manage`, `members:read`). Resolved from the caller's custom role when one applies and the plan includes it, otherwise from the built-in role. Additive to `user_role` — clients gate UI on this list.
- `logo_url` (string, optional, nullable) — Signed URL for the workspace logo (ActiveStorage blob URL). `null` when no logo is uploaded. URLs are time-limited — re-fetch the workspace record to get a fresh URL.
- `legal_identity` (WorkspaceLegalIdentity, optional, nullable) — The workspace's legal identity — registered name, tax IDs, VAT registration, contact details, and addresses. This is the same data that appears as `supplier` on every document the workspace issues. This surface is read-only.

## Errors

### 401 Unauthorized Error

Missing or invalid authentication credentials.

- `error` (string, required) — Machine-readable error code. Stable across releases — clients should branch on this rather than the human-readable message.
- `message` (string, required) — Human-readable error description, localized to `Accept-Language`. Subject to wording changes between releases.
- `request_id` (string, required) — Server-side request identifier. Same value as the `X-Request-Id` response header. Quote this in support tickets so we can pull the matching server log line.
- `docs_url` (string, required) — URL of the per-error-code documentation page. Useful for SDK error subclasses to deep-link from a stack trace to the docs explaining the cause + remediation.

### 403 Forbidden Error

Authenticated, but the token's scope or the user's role does not permit this action. Both the token scope and the user's role must allow the action. Also returned when a workspace token is sent to an endpoint that acts for a user (`/user`, `/user/workspaces`, devices, notification preferences, diagnostics): a workspace token has no user behind it, so use a personal access token or a JWT there.

- `error` (string, required) — Machine-readable error code. Stable across releases — clients should branch on this rather than the human-readable message.
- `message` (string, required) — Human-readable error description, localized to `Accept-Language`. Subject to wording changes between releases.
- `request_id` (string, required) — Server-side request identifier. Same value as the `X-Request-Id` response header. Quote this in support tickets so we can pull the matching server log line.
- `docs_url` (string, required) — URL of the per-error-code documentation page. Useful for SDK error subclasses to deep-link from a stack trace to the docs explaining the cause + remediation.

### 404 Not Found Error

Resource does not exist, or exists but is not visible to the authenticated principal (cross-workspace isolation returns 404, not 403, to avoid leaking existence).

- `error` (string, required) — Machine-readable error code. Stable across releases — clients should branch on this rather than the human-readable message.
- `message` (string, required) — Human-readable error description, localized to `Accept-Language`. Subject to wording changes between releases.
- `request_id` (string, required) — Server-side request identifier. Same value as the `X-Request-Id` response header. Quote this in support tickets so we can pull the matching server log line.
- `docs_url` (string, required) — URL of the per-error-code documentation page. Useful for SDK error subclasses to deep-link from a stack trace to the docs explaining the cause + remediation.

### 429 Too Many Requests Error

Rate limit exceeded. Retry after the window resets.

- `error` (string, required) — Machine-readable error code. Stable across releases — clients should branch on this rather than the human-readable message.
- `message` (string, required) — Human-readable error description, localized to `Accept-Language`. Subject to wording changes between releases.
- `request_id` (string, required) — Server-side request identifier. Same value as the `X-Request-Id` response header. Quote this in support tickets so we can pull the matching server log line.
- `docs_url` (string, required) — URL of the per-error-code documentation page. Useful for SDK error subclasses to deep-link from a stack trace to the docs explaining the cause + remediation.

## Types

### WorkspaceLegalIdentity

- `legal_registration_id` (string, optional, nullable) — Legal/company registration identifier (SK/CZ IČO). `_id` denotes *identifier*, not a foreign key; the value is an opaque string and may be alphanumeric outside SK/CZ (e.g. UK `SC123456`).
- `tax_id` (string, optional, nullable) — Tax registration identifier (SK/CZ DIČ). An identifier string, not a number.
- `vat_id` (string, optional, nullable) — VAT identifier (SK/CZ IČ DPH). Alphanumeric with a country prefix (e.g. `SK2020123456`, `ATU12345678`) — an identifier, not a number.
- `vat_payer_type` (enum, optional, nullable) — VAT registration status (standard | non_payer_vat | foreign); nullable.
  - Allowed values: `standard`, `non_payer_vat`, `foreign`
- `email` (string, optional, nullable)
- `phone_number` (string, optional, nullable)
- `website` (string, optional, nullable)
- `address` (AddressEmbed, optional, nullable)
- `postal_address` (AddressEmbed, optional, nullable)
- `vat_period` (enum, optional, nullable) — VAT filing period. Declared here rather than on the shared PartyIdentity facet: it is only meaningful for the caller's own registration, never for a document's counterparty.
  - Allowed values: `month`, `quarter`, `year`
- `register_text` (string, optional, nullable) — Commercial-register statement printed on issued documents ("Zapísaná v OR SR ..."). Issuer-side only — not returned for counterparties, since you never know a customer's register entry. Reflects the current identity version; documents print the version pinned at issue.
- `main_activity_code` (string, optional, nullable) — The company's main activity as its Slovak income-tax return files it: an SK NACE Rev. 2 subclass (five digits). Null until confirmed (tax return, company settings, or a register update). Own company only.
- `main_activity_register_code` (string, optional, nullable) — The Slovak register's SK NACE Rev. 2.1 class `main_activity_code` was confirmed against. When the register moves to another class, the register check (`GET …/company_profile/register_check`) reports a `main_activity` discrepancy.
- `legal_name` (string, optional, nullable) — The workspace's official registered legal name (with legal form, e.g. "Stark Codes, s.r.o.") — the customer-facing name rendered as `supplier` on issued documents. Use this (not `display_name`) wherever the name represents the legal entity.
- `legal_form` (string, optional, nullable) — Legal-form abbreviation rendered on documents (e.g. `s.r.o.`, `a.s.`, `živnosť`). Derived from `legal_form_id`.
- `legal_form_id` (long, optional, nullable)

### AddressEmbed

- `id` (long, required)
- `street` (string, optional, nullable)
- `city` (string, optional, nullable)
- `postal_code` (string, optional, nullable)
- `country_code` (string, optional, nullable) — ISO 3166-1 alpha-2 country code, uppercase (e.g. "SK").

## Examples

**Response**

```json
{
  "id": 1,
  "time_zone": "Europe/Bratislava",
  "default": true,
  "created_at": "2024-01-15T09:30:00Z",
  "updated_at": "2024-01-15T09:30:00Z",
  "display_name": "SC",
  "accounting_type": "simple",
  "user_role": "owner",
  "permissions": [
    "documents:manage",
    "expenses:manage",
    "members:read"
  ],
  "logo_url": "string",
  "legal_identity": {
    "legal_registration_id": "string",
    "tax_id": "string",
    "vat_id": "string",
    "vat_payer_type": "standard",
    "email": "string",
    "phone_number": "string",
    "website": "string",
    "address": {
      "id": 1,
      "street": "string",
      "city": "string",
      "postal_code": "string",
      "country_code": "string"
    },
    "postal_address": {
      "id": 1,
      "street": "string",
      "city": "string",
      "postal_code": "string",
      "country_code": "string"
    },
    "vat_period": "month",
    "register_text": "OR SR BA I, odd. Sro, vl. 1/B",
    "main_activity_code": "62020",
    "main_activity_register_code": "6220",
    "legal_name": "Stark Codes, s.r.o.",
    "legal_form": "s.r.o.",
    "legal_form_id": 1
  }
}
```

**SDK Code**

```python
import requests

url = "https://app.lucanto.eu/api/v1/user/workspaces/42"

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

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

print(response.json())
```

```javascript
const url = 'https://app.lucanto.eu/api/v1/user/workspaces/42';
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://app.lucanto.eu/api/v1/user/workspaces/42"

	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://app.lucanto.eu/api/v1/user/workspaces/42")

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://app.lucanto.eu/api/v1/user/workspaces/42")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://app.lucanto.eu/api/v1/user/workspaces/42', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://app.lucanto.eu/api/v1/user/workspaces/42");
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://app.lucanto.eu/api/v1/user/workspaces/42")! 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()
```