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

# List Stacks

> Retrieve all stacks in your ToolRouter account

## Overview

Returns a list of all stacks associated with your ToolRouter account, including their configuration and server details.

## Endpoint

```
GET https://api.toolrouter.ai/v1/stacks
```

## Authentication

This endpoint requires an API key. Include it in the Authorization header:

```bash theme={null}
Authorization: Bearer YOUR_API_KEY
```

## Response

<ResponseField name="stacks" type="array">
  Array of stack objects

  <Expandable title="Stack Object">
    <ResponseField name="stack_id" type="string">
      Unique identifier for the stack
    </ResponseField>

    <ResponseField name="stack_name" type="string">
      Human-readable name of the stack
    </ResponseField>

    <ResponseField name="configuration" type="object">
      Stack configuration settings

      <Expandable title="Configuration Object">
        <ResponseField name="analytics_enabled" type="boolean">
          Whether analytics are enabled for this stack
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="servers" type="array">
      Array of servers added to this stack

      <Expandable title="Server Object">
        <ResponseField name="server_name" type="string">
          Name of the server
        </ResponseField>

        <ResponseField name="enabled_tools" type="array">
          Array of tool IDs that are enabled for this server
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="created_at" type="string">
      ISO timestamp when the stack was created
    </ResponseField>

    <ResponseField name="updated_at" type="string">
      ISO timestamp when the stack was last updated
    </ResponseField>
  </Expandable>
</ResponseField>

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.toolrouter.ai/v1/stacks" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json"
  ```

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

  headers = {
      "Authorization": "Bearer YOUR_API_KEY",
      "Content-Type": "application/json"
  }

  response = requests.get(
      "https://api.toolrouter.ai/v1/stacks",
      headers=headers
  )

  stacks = response.json()
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.toolrouter.ai/v1/stacks', {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    }
  });

  const stacks = await response.json();
  ```
</CodeGroup>

## Example Response

```json theme={null}
[
  {
    "stack_id": "stack_123e4567-e89b-12d3-a456-426614174000",
    "stack_name": "Production Stack",
    "configuration": {
      "analytics_enabled": true
    },
    "servers": [
      {
        "server_name": "Gmail Server",
        "enabled_tools": [
          "gmail_send_email",
          "gmail_search_emails",
          "gmail_read_email"
        ]
      },
      {
        "server_name": "Google Calendar",
        "enabled_tools": [
          "calendar_list_events",
          "calendar_create_event"
        ]
      }
    ],
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-20T14:45:00Z"
  },
  {
    "stack_id": "stack_987f6543-e21c-34d5-b678-426614174001",
    "stack_name": "Development Stack",
    "configuration": {
      "analytics_enabled": false
    },
    "servers": [
      {
        "server_name": "Linear",
        "enabled_tools": [
          "linear_create_issue",
          "linear_search_issues"
        ]
      }
    ],
    "created_at": "2024-01-10T08:15:00Z",
    "updated_at": "2024-01-18T16:20:00Z"
  }
]
```

## Error Responses

<ResponseField name="401 Unauthorized">
  Invalid or missing API key

  ```json theme={null}
  {
    "detail": "Unauthorized"
  }
  ```
</ResponseField>

<ResponseField name="429 Too Many Requests">
  Rate limit exceeded

  ```json theme={null}
  {
    "detail": "Too many requests"
  }
  ```
</ResponseField>

<ResponseField name="500 Internal Server Error">
  Server error occurred

  ```json theme={null}
  {
    "detail": "Failed to list stacks"
  }
  ```
</ResponseField>
