{
  "openapi": "3.0.0",
  "info": {
    "title": "Pipecat Cloud",
    "version": "1.0.0",
    "description": "Private API for Pipecat Cloud agent management"
  },
  "servers": [
    {
      "url": "https://api.pipecat.daily.co/v1",
      "description": "API server"
    }
  ],
  "paths": {
    "/agents": {
      "get": {
        "summary": "List all agents",
        "operationId": "listServices",
        "security": [
          {
            "PrivateKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "includeActiveDeployment",
            "in": "query",
            "required": false,
            "description": "Whether to include the active deployment details in the response",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "description": "Filter agents by region. If not specified, returns agents from all regions.",
            "schema": {
              "type": "string",
              "example": "us-west"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of agents retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "services": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ServiceListItem"
                      }
                    }
                  }
                },
                "example": {
                  "services": [
                    {
                      "id": "c359e1ea-64d6-4bcf-a7c6-28d3bd1c8909",
                      "name": "voice-starter",
                      "region": "us-west",
                      "desiredDeploymentId": "4cab03c7-8f53-418d-9c3c-91a1265d179e",
                      "activeDeploymentId": "4cab03c7-8f53-418d-9c3c-91a1265d179e",
                      "reconciledDeploymentId": "4cab03c7-8f53-418d-9c3c-91a1265d179e",
                      "organizationId": "7c489df3-7d1d-482f-b1ed-51300f630645",
                      "createdAt": "2025-04-09T15:01:17.414Z",
                      "updatedAt": "2025-04-18T20:29:19.181Z",
                      "deletedAt": null
                    },
                    {
                      "id": "4e0d1f30-77a8-4283-a054-14a63b06720f",
                      "name": "voice-starter-krisp",
                      "region": "us-west",
                      "desiredDeploymentId": "62e89096-23c6-4265-984b-f419696c58da",
                      "activeDeploymentId": "62e89096-23c6-4265-984b-f419696c58da",
                      "reconciledDeploymentId": "62e89096-23c6-4265-984b-f419696c58da",
                      "organizationId": "7c489df3-7d1d-482f-b1ed-51300f630645",
                      "createdAt": "2025-04-09T15:59:50.465Z",
                      "updatedAt": "2025-04-11T16:54:54.246Z",
                      "deletedAt": null
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "PrivateKeyAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Authentication requires a Pipecat Cloud Private API token.\n\nGenerate a Private API key from your Dashboard (Settings > API Keys > Private > Create key) and include it as a Bearer token in the Authorization header."
      }
    },
    "schemas": {
      "ServiceListItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the agent"
          },
          "name": {
            "type": "string",
            "description": "Name of the agent"
          },
          "region": {
            "type": "string",
            "description": "The region where the agent is deployed"
          },
          "desiredDeploymentId": {
            "type": "string",
            "description": "ID of the deployment that was requested. Use this to track which deployment should be running."
          },
          "activeDeploymentId": {
            "type": "string",
            "description": "**Deprecated**: Use `desiredDeploymentId` instead. ID of the requested deployment.",
            "deprecated": true
          },
          "reconciledDeploymentId": {
            "type": "string",
            "description": "ID of the deployment that the operator has actually reconciled. Compare with `desiredDeploymentId` to determine if a deployment update has been processed."
          },
          "organizationId": {
            "type": "string",
            "description": "Organization ID this agent belongs to"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "Creation timestamp of the agent"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Last update timestamp"
          },
          "deletedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Deletion timestamp, if the agent has been deleted",
            "nullable": true
          },
          "deployment": {
            "type": "object",
            "description": "Details of the active deployment (only included when includeActiveDeployment=true)",
            "properties": {
              "id": {
                "type": "string",
                "description": "Deployment ID"
              },
              "serviceId": {
                "type": "string",
                "description": "Service ID"
              },
              "manifest": {
                "type": "object",
                "description": "Kubernetes manifest for the deployment"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time",
                "description": "Creation timestamp of the deployment"
              },
              "updatedAt": {
                "type": "string",
                "format": "date-time",
                "description": "Last update timestamp of the deployment"
              }
            }
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Error message"
          },
          "code": {
            "type": "string",
            "description": "Error code"
          }
        }
      }
    }
  },
  "security": [
    {
      "PrivateKeyAuth": []
    }
  ]
}