> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xenia.team/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> How the Xenia API works, what you need to get started, and how to build your first integration.

The Xenia API gives you programmatic access to your operations data. Use it to keep Xenia in sync with your HR and location systems, pull checklist and task data into your BI tools, and create work in Xenia from events in other systems.

## How the API works

The Xenia API is a REST API. You send HTTPS requests to `https://api.xenia.team` and get JSON back.

Every request is authenticated with a client key and secret that belong to one Xenia workspace. Each key acts as a user in that workspace, so the API follows the same rules as the Xenia app: a request can only see and change what that user could see and change in the app.

## What you can build

Most integrations fall into one of three patterns.

**Keep Xenia in sync with your systems.** Push users, roles, and locations from your HR system or store master on a schedule, so new hires get access on day one and your location data stays current. See [User lifecycle](https://docs.xenia.team/guides/workflows/user-lifecycle.md) and [HRIS sync](https://docs.xenia.team/guides/integrations/hris-sync.md).

**Pull operational data out.** Export submissions, task completion, and analytics into Power BI or your data warehouse for reporting across locations. See [Reporting & data extraction](https://docs.xenia.team/guides/integrations/data-extraction.md).

**Create work from other systems.** Create tasks, projects, and actions in Xenia when something happens in another system. See [Task management](https://docs.xenia.team/guides/workflows/task-management.md).

## Requirements

To use the API, you need:

* A Xenia workspace with admin or owner access
* The **Public API** add-on enabled for your workspace. If you don't see **Settings → Public Integrations**, contact your Xenia representative.
* A client key and secret, created in **Settings → Public Integrations**

Some endpoints also need a feature enabled for your workspace, such as Sub-Locations or Actions. The endpoint's page says when this applies.

## Authentication

Create a client key in **Settings → Public Integrations → Create Client Key**. When you create it, you choose the default user the key acts as. The client secret is shown only once, so store it somewhere secure.

Send your credentials as headers on every request:

```bash theme={null}
-H "x-client-key: YOUR_CLIENT_KEY"
-H "x-client-secret: YOUR_CLIENT_SECRET"
```

To act as a different user in the workspace, add an `x-client-user` header with that user's ID.

You don't need to send a workspace header. The workspace comes from your key. Some endpoint paths include `{workspaceId}`, and that must be the workspace your key belongs to.

## Permissions

Each request runs as the key's default user, or the user in `x-client-user`. That user's role and location access decide what the request can do. If results look incomplete, or a request is refused, check what that user can access in the Xenia app.

## Responses and pagination

Most responses are JSON, with the result under `data`. List endpoints page through results, and the method depends on the endpoint: some return page details in `meta`, some use `limit` and `offset`, and some use a cursor. Each endpoint page shows its exact response and paging.

## Errors

A `401` means your client key or secret is wrong. A `403` usually means the user doesn't have permission, the route isn't open to API keys, or a required feature isn't enabled. A `422` means the request body didn't pass validation, and the message says why. See [Error handling](https://docs.xenia.team/guides/error-handling.md) for details.

## Rate limits

You can send up to 10,000 requests per 5 minutes from one IP address. Login, sign-up, and password reset are limited to 100 per 5 minutes. Above the limit, requests return `403` until volume drops. See [Rate limits](https://docs.xenia.team/guides/rate-limits.md).

## Build your first integration

**1. Create a client key**

In the Xenia web app, go to **Settings → Public Integrations → Create Client Key**. Name the key, choose its default user, and save the key and secret.

**2. Check your credentials**

Confirm the key works and see which user and workspace it acts as:

```bash theme={null}
curl -X GET "https://api.xenia.team/api/v1/mgt/user-context" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET"
```

A `200` means you're connected. A `401` means the key or secret is wrong.

**3. Read some data**

List the users in your workspace:

```bash theme={null}
curl -X GET "https://api.xenia.team/api/v1/mgt/users" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET"
```

**4. Pick a workflow**

Follow a guide for what you're building: [user lifecycle](https://docs.xenia.team/guides/workflows/user-lifecycle.md), [submission exports](https://docs.xenia.team/guides/workflows/submission-exports.md), or [task management](https://docs.xenia.team/guides/workflows/task-management.md). Each one walks through the endpoints in order.

## Next steps

> [card] [Core concepts](https://docs.xenia.team/guides/core-concepts.md)
>
> How workspaces, locations, templates, and tasks fit together

> [card] [Quickstart](https://docs.xenia.team/guides/getting-started.md)
>
> A detailed setup walkthrough with example responses


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.