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

# Quick Start Guide

> Get up and running with the Tournament Platform in minutes - create your first tournament and integrate with the APIs

# Quick Start Guide

Get your first tournament running and integrate with the Tournament Platform APIs in just a few steps. This guide covers the essential integration points for both Casino System and Game Platform integrations.

## Prerequisites

Before you begin, ensure you have:

* **API Keys**: Operator API keys with appropriate permissions
* **Development Environment**: Ability to make HTTP requests to the Tournament Platform
* **Webhook Endpoint** (optional): For receiving real-time tournament events

<Info>
  **Production Environment**: This guide uses the production Tournament Platform API. Use appropriate testing strategies for your integration.
</Info>

## Step 1: Authentication Setup

### Obtain API Keys

<Steps>
  <Step title="Access Operator Dashboard">
    Log into your Tournament Platform operator dashboard
  </Step>

  <Step title="Create API Key">
    Navigate to **Settings** → **API Keys** → **Create New Key**
  </Step>

  <Step title="Configure Permissions">
    Grant these permissions for the quickstart:

    * `tournaments.read`
    * `tournaments.write`
    * `players.read`
    * `players.write`
    * `results.read`
  </Step>

  <Step title="Copy API Key">
    **Important**: Copy the API key secret immediately - it won't be shown again
  </Step>
</Steps>

### Test Authentication

Verify your API key works:

```bash theme={null}
curl -X GET "https://ts.playservices.tech/api/tournaments" \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json"
```

**Expected Response (200 OK):**

```json theme={null}
{
  "tournaments": [],
  "pagination": {
    "total": 0,
    "limit": 50,
    "offset": 0
  },
  "meta": {
    "operator_id": "op_1234567890abcdef",
    "permissions": ["tournaments.read", "tournaments.write"]
  }
}
```

## Step 2: Create Your First Tournament

Create a tournament that starts at a specific time:

```javascript theme={null}
const createTournament = async () => {
  // Schedule tournament for 1 hour from now
  const startTime = new Date();
  startTime.setHours(startTime.getHours() + 1);
  
  const response = await fetch('https://ts.playservices.tech/api/tournaments', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer your-api-key',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'My First Tournament',
      startTime: startTime.toISOString(),
      gameSlug: 'crash-classic',
      maxPlayers: 50,
      minPlayers: 5,
      entryFee: 10.00,
      prizePool: {
        type: 'percentage',
        distribution: [50, 30, 20]
      },
      rebuyEnabled: true,
      rebuyFee: 10.00,
      maxEntriesPerPlayer: 3
    })
  });
  
  const tournament = await response.json();
  console.log('Tournament created:', tournament.tournamentId);
  return tournament;
};
```

**Expected Response:**

```json theme={null}
{
  "tournamentId": "12345",
  "status": "scheduled",
  "name": "My First Tournament", 
  "startTime": "2024-01-15T21:00:00Z",
  "gameSlug": "crash-classic",
  "maxPlayers": 50,
  "currentPlayers": 0,
  "entryFee": 10.00,
  "registrationOpen": true
}
```

## Step 3: Register Players

Register a player for your tournament:

```javascript theme={null}
const registerPlayer = async (tournamentId) => {
  const response = await fetch(`https://ts.playservices.tech/api/tournaments/${tournamentId}/players`, {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer your-api-key',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      userId: 'player_123',
      displayName: 'TestPlayer',
      buyInAmount: 10.00
    })
  });
  
  const registration = await response.json();
  console.log('Player registered:', registration.playerId);
  console.log('Game URL:', registration.gameUrl);
  return registration;
};
```

**Key Response Fields:**

* `playerId`: Tournament-specific player identifier
* `jwtToken`: Authentication token for game access
* `gameUrl`: Direct URL to join tournament game
* `roomUrl`: Game room URL for integration

## Step 4: Monitor Tournament Status

Monitor your tournament in real-time:

```javascript theme={null}
const checkTournamentStatus = async (tournamentId) => {
  const response = await fetch(`https://ts.playservices.tech/api/tournaments/${tournamentId}/status`, {
    headers: {
      'Authorization': 'Bearer your-api-key'
    }
  });
  
  const status = await response.json();
  console.log('Tournament Status:', status.status);
  console.log('Current Players:', status.currentPlayers);
  console.log('Prize Pool:', status.prizePool.totalAmount);
  
  return status;
};
```

## Step 5: Access Results

Once your tournament completes, retrieve the results:

```javascript theme={null}
const getTournamentResults = async (tournamentId) => {
  const response = await fetch(`https://ts.playservices.tech/api/tournaments/${tournamentId}/results`, {
    headers: {
      'Authorization': 'Bearer your-api-key'
    }
  });
  
  const results = await response.json();
  console.log('Winners:', results.winners);
  console.log('Prize Distribution:', results.prizeDistribution);
  
  return results;
};
```

## Next Steps

Now that you've created your first tournament, explore these advanced topics:

<CardGroup cols={2}>
  <Card title="Tournament Types" icon="trophy" href="/tournament-types/overview">
    Learn about Scheduled vs Hop-on/Off tournament formats and their differences.
  </Card>

  <Card title="Casino Integration" icon="building" href="/casino-integration/introduction">
    Deep dive into external APIs for complete casino system integration.
  </Card>

  <Card title="Game Platform Integration" icon="gamepad" href="/game-platform-integration/introduction">
    Explore internal APIs for game system integration and real-time communication.
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference/introduction">
    Complete API documentation with interactive examples and schemas.
  </Card>
</CardGroup>

## Need Help?

<Info>
  Our support team is available to help with integration questions and technical issues at **[support@playservices.tech](mailto:support@playservices.tech)**
</Info>
