# Workspaces and regions

> Find the workspace id and the data region every Stacksync API path and regional resource needs

Source: https://docs.stacksync.com/api-reference/workspaces-and-regions

Every resource belongs to a workspace, and most live in one data region. Paths name the workspace, and operations on a regional resource take its region as the `region` query parameter.

## Workspaces

Paths start with the workspace: `/v1/workspaces/{workspace_id}/…`. [List workspaces](/api-reference/workspaces/list_workspaces) returns the workspaces your key can act in, with your role in each and the workspace's default region:

```bash
curl https://api.stacksync.com/v1/workspaces \
  -H "Authorization: Bearer $STACKSYNC_API_KEY"
```

```json
{
  "data": [
    { "workspace_id": 1234, "workspace_name": "Acme", "role": "editor", "default_region": "usnv" }
  ],
  "has_more": false,
  "limit": 50,
  "offset": 0
}
```

A workspace API key lists its own workspace only. [Get a workspace](/api-reference/workspaces/get_workspace) returns one workspace, and [List workspace members](/api-reference/workspaces/list_workspace_members) its people and their roles.

## Regions

Each resource's data is stored and processed in one region:

| `region` | Location      |
| -------- | ------------- |
| `besg`   | Europe        |
| `usnv`   | United States |

[List regions](/api-reference/workspaces/regions/list_regions) returns them. A workspace can hold resources in both regions; its `default_region` is where new resources go by default.

* When you create a resource, pass `region=<default_region>` unless it must live elsewhere.
* When you read, change or delete a resource, pass the region it lives in. Lists and answers show each resource's region.
* When an operation's page doesn't list a `region` parameter, it reads every region.

```bash
curl "https://api.stacksync.com/v1/workspaces/1234/queues?region=usnv" \
  -H "Authorization: Bearer $STACKSYNC_API_KEY"
```

All resources are served by `https://api.stacksync.com` whatever their region; Genie runs are served by `https://genies.stacksync.com`.