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

# List Productions

> Retrieve all productions

## Overview

Returns a list of all productions (show runs at specific theatres) in the database. Optionally filter by theatre ID.

## Query Parameters

<ParamField query="theatre_id" type="string">
  Filter productions by theatre ID
</ParamField>

## Request

<CodeGroup>
  ```bash cURL theme={null}
  # Get all productions
  curl https://entertheatre.com/api/productions

  # Filter by theatre
  curl https://entertheatre.com/api/productions?theatre_id=theatre-001
  ```

  ```javascript JavaScript theme={null}
  // Get all productions
  const response = await fetch('https://entertheatre.com/api/productions');
  const productions = await response.json();

  // Filter by theatre
  const filtered = await fetch('https://entertheatre.com/api/productions?theatre_id=theatre-001');
  const theatreProductions = await filtered.json();
  ```

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

  # Get all productions
  response = requests.get('https://entertheatre.com/api/productions')
  productions = response.json()

  # Filter by theatre
  response = requests.get('https://entertheatre.com/api/productions', params={'theatre_id': 'theatre-001'})
  theatre_productions = response.json()
  ```
</CodeGroup>

## Response

<ResponseField name="productions" type="array">
  Array of production objects

  <Expandable title="Production Object">
    <ResponseField name="id" type="string" required>
      Unique identifier for the production
    </ResponseField>

    <ResponseField name="show_id" type="string" required>
      ID of the associated show
    </ResponseField>

    <ResponseField name="theatre_id" type="string" required>
      ID of the theatre where the production runs
    </ResponseField>

    <ResponseField name="opening_date" type="string" required>
      Opening date of the production (ISO 8601 format)
    </ResponseField>

    <ResponseField name="closing_date" type="string">
      Closing date of the production (ISO 8601 format), null if open-ended
    </ResponseField>

    <ResponseField name="show" type="object">
      Nested show object with full show details
    </ResponseField>
  </Expandable>
</ResponseField>

### Example Response

```json theme={null}
[
  {
    "id": "prod-001",
    "show_id": "550e8400-e29b-41d4-a716-446655440000",
    "theatre_id": "theatre-001",
    "opening_date": "1986-10-09",
    "closing_date": null,
    "show": {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "The Phantom of the Opera",
      "type": "musical",
      "description": "Andrew Lloyd Webber's legendary musical...",
      "image": "https://rluylvquemmzgljdklby.supabase.co/storage/v1/object/public/shows/phantom.jpg"
    }
  },
  {
    "id": "prod-002",
    "show_id": "550e8400-e29b-41d4-a716-446655440001",
    "theatre_id": "theatre-002",
    "opening_date": "2017-12-21",
    "closing_date": null,
    "show": {
      "id": "550e8400-e29b-41d4-a716-446655440001",
      "name": "Hamilton",
      "type": "musical",
      "description": "The story of America's founding father...",
      "image": "https://rluylvquemmzgljdklby.supabase.co/storage/v1/object/public/shows/hamilton.jpg"
    }
  }
]
```

## Status Codes

| Status | Description                            |
| ------ | -------------------------------------- |
| `200`  | Success - returns array of productions |
| `500`  | Server error                           |
