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

# Before you start

Stafflion and your agency set up the integration together before events flow. Follow this order.

## Onboarding

1. **Stafflion enables the integration** for your agency.
2. **Stafflion gives you staging credentials**: a client ID and a client secret for the staging environment.
3. **Your agency tests in staging.** Send events for the shifts you work on, and call the synchronized shifts API to confirm what is synchronized.
4. **Stafflion validates the integration** in staging and issues production credentials.

Start in staging. Each environment has its own credentials: a staging client ID does not work in production. The `audience` in the token request selects the environment.

## Where shifts come from

* **Shifts Stafflion publishes to your agency.** Your events reference them with the identifiers Stafflion sent. `shift_request` is accepted only for these shifts.
* **Shifts your agency creates.** Send `shift_claimed` with the shift times. Stafflion creates the shift when it does not know it. Other events for a shift Stafflion does not know are rejected. After the claim is accepted, the shift appears in the synchronized shifts API.

Stafflion creates most test shifts. Your agency can also create one in staging: send `shift_claimed` with `partner_facility_id`, `partner_shift_id`, `shift_start_time`, `shift_end_time`, and `partner_clinician`.

## Shift requests

Stafflion approves a `shift_request` by calling your partner API. The endpoint, authentication, and payloads are agreed during onboarding.

## Limits

Stafflion does not publish a rate limit. Agree your expected volume with Stafflion during onboarding.

## Synchronized shifts before the integration is enabled

Until Stafflion enables the integration for your agency, the synchronized shifts API returns an empty list.