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

# Quickstart

> Get started with the Switchyard API in minutes

# Quickstart

This guide will help you make your first API call to Switchyard.

## Prerequisites

* Access to the Switchyard admin dashboard
* A user account with appropriate permissions
* Your Supabase project credentials (for direct API access)

## Authentication

Switchyard uses Supabase Auth for authentication. There are two main ways to authenticate:

### Option 1: Session-based (Admin UI)

When logged into the admin dashboard, your session cookie is automatically included with requests.

### Option 2: Bearer Token (API/Mobile)

For programmatic access, authenticate with Supabase and use the JWT:

```bash theme={null}
# 1. Get a token from Supabase
curl -X POST 'https://your-project.supabase.co/auth/v1/token?grant_type=password' \
  -H "apikey: YOUR_ANON_KEY" \
  -H "Content-Type: application/json" \
  -d '{"email": "user@example.com", "password": "password"}'

# 2. Use the access_token in API calls
curl 'https://api.switchyard.run/admin/products' \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
```

## Your First API Call

Let's fetch the list of products:

<CodeGroup>
  ```bash cURL theme={null}
  curl 'https://api.switchyard.run/admin/products?limit=10' \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.switchyard.run/admin/products?limit=10', {
    headers: {
      'Authorization': `Bearer ${accessToken}`
    }
  });
  const { products } = await response.json();
  console.log(products);
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://api.switchyard.run/admin/products',
      params={'limit': 10},
      headers={'Authorization': f'Bearer {access_token}'}
  )
  products = response.json()['products']
  ```
</CodeGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Authentication Deep Dive" icon="key" href="/authentication/overview">
    Learn about roles, permissions, and service accounts
  </Card>

  <Card title="API Reference" icon="book" href="/api-reference/introduction">
    Explore all available endpoints
  </Card>
</CardGroup>
