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

# Quickstart

> Get your first NexSpace API call working in 5 minutes

# Quickstart

This guide walks you through creating an API key and making your first call
to the NexSpace API.

## Step 1: Get an API Key

1. Log in to [NexSpace](https://app.nexspace365.com)
2. Navigate to **Settings → API Keys**
3. Click **Create Key**
4. Choose your scopes (start with `shifts:read`, `staff:read`, `facilities:read`)
5. Copy the key — it's shown only once

Your key looks like: `nex_live_aBcDeFgHiJkLmNoPqRsT...`\
For isolated testing, create a **`nex_test_…`** key instead — same API host (`https://api.nexspace365.com`), sandbox rows only.

<Warning>
  Store your API key securely. Never commit it to version control or share it
  in client-side code.
</Warning>

### Mintlify Try-it

On API reference pages, open **Try It** and paste `Bearer <your key>`. There is no separate sandbox URL and no shared demo credential — use your own key from Settings → API Keys.

## Step 2: Make Your First Call

<CodeGroup>
  ```bash cURL theme={null}
  curl -H "Authorization: Bearer nex_live_YOUR_KEY" \
       https://api.nexspace365.com/api/facilities
  ```

  ```typescript TypeScript SDK theme={null}
  import { NexSpace } from '@nexspace/sdk';

  const client = new NexSpace({ apiKey: 'nex_live_YOUR_KEY' });
  const facilities = await client.facilities.list();
  console.log(facilities);
  ```

  ```python Python SDK theme={null}
  from nexspace import NexSpace

  client = NexSpace(api_key="nex_live_YOUR_KEY")
  facilities = client.facilities.list()
  print(facilities)
  ```

  ```bash CLI theme={null}
  nexspace login
  nexspace facilities list
  ```
</CodeGroup>

## Step 3: Try an MCP Tool Call

AI agents interact via the MCP protocol. Here's how to call a tool directly:

```bash theme={null}
curl -X POST https://mcp.nexspace365.com/mcp \
  -H "Authorization: Bearer nex_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/list",
    "params": {}
  }'
```

This returns all 16 available tools. To invoke one:

```bash theme={null}
curl -X POST https://mcp.nexspace365.com/mcp \
  -H "Authorization: Bearer nex_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 2,
    "method": "tools/call",
    "params": {
      "name": "listFacilities",
      "arguments": {}
    }
  }'
```

## Step 4: Set Up Webhooks (Optional)

Receive real-time events when things happen in NexSpace:

```bash theme={null}
curl -X POST https://api.nexspace365.com/api/webhooks \
  -H "Authorization: Bearer nex_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My Integration",
    "url": "https://your-app.com/webhooks/nexspace",
    "events": ["shift_filled", "credential_expired"]
  }'
```

The response includes a `signingSecret` — use it to verify incoming webhook
signatures.

## Next Steps

<CardGroup cols={2}>
  <Card title="Authentication Deep Dive" icon="key" href="/authentication">
    OAuth 2.1, scopes, key rotation, and device-code flow.
  </Card>

  <Card title="MCP Protocol" icon="brain" href="/concepts/mcp">
    Full MCP integration guide for AI agents.
  </Card>

  <Card title="TypeScript SDK" icon="js" href="/sdks/typescript">
    Install and configure the TypeScript SDK.
  </Card>

  <Card title="CLI Reference" icon="terminal" href="/cli/overview">
    Automate NexSpace from the command line.
  </Card>
</CardGroup>
