# Stacksync API

> The REST API of Stacksync: workspaces, connections, syncs, workflows, Genies, queues, variables, folders, files, knowledge bases and API proxies

Source: https://docs.stacksync.com/api-reference

The Stacksync API manages your workspace's resources over HTTPS with JSON: create and run syncs, workflows and Genies, and manage the connections, queues, variables and files they use. This reference lists every operation by resource in the sidebar; each page shows its parameters, its answers, code samples in curl, Python and JavaScript, and a form to try it. The same reference is one machine-readable document: [`/openapi.json`](https://docs.stacksync.com/openapi.json) (OpenAPI 3.1).

<Callout type="info">
  Are you an AI agent? Read [`/openapi.json`](https://docs.stacksync.com/openapi.json) for the whole API, or any page of this reference as Markdown by adding `.md` to its URL. [For AI agents](/api-reference/for-ai-agents) has the rules on one screen.
</Callout>

## Base URLs

| API           | Base URL                       |
| ------------- | ------------------------------ |
| Stacksync API | `https://api.stacksync.com`    |
| Genie runs    | `https://genies.stacksync.com` |

All paths start with `/v1`. See [Versioning and changelog](/api-reference/versioning-and-changelog).

## One header

Every request carries an API key in the `Authorization` header. There is no OAuth flow and no request signature.

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

There are two types of key, the workspace API key (`workspace_…`) and the user API key (`user_…`). [Authentication](/api-reference/authentication) explains which to use and what each can do.

## Workspaces and regions

Resources belong to a workspace and live in one of two data regions, `besg` (Europe) or `usnv` (United States). Paths name the workspace (`/v1/workspaces/{workspace_id}/…`) and operations on a regional resource take a `region` query parameter. [Workspaces and regions](/api-reference/workspaces-and-regions) shows how to find both.

## Answers

Lists answer one envelope, with offset pagination:

```json
{ "data": [], "has_more": false, "limit": 50, "offset": 0 }
```

Errors answer a 4xx status and a body that names the problem:

```json
{ "error": "Invalid API Key", "msg": "The API Key provided in the request is invalid" }
```

The older sync operations page and report errors their own way; their pages show it. Most answers carry an `X-Request-Id` header: quote it when you contact support. Details in [Pagination and idempotency](/api-reference/pagination-and-idempotency) and [Errors](/api-reference/errors).

## Try it from this page

Each operation page has a form to send the request. The key you type is sent from your browser straight to `api.stacksync.com`, as your own code would send it. It never passes through docs.stacksync.com and is not stored by Stacksync; your browser keeps it only for this tab, until you close it.

## For AI agents

Agents read the reference as Markdown: add `.md` to any page URL, or load the OpenAPI document. [For AI agents](/api-reference/for-ai-agents) is the one-screen version of these rules.