{
  "info": {
    "description": "API for CraftCX conversation scoring and analysis",
    "title": "CraftCX API",
    "version": "1.0.0"
  },
  "openapi": "3.0.0",
  "servers": [
    {
      "url": "https://api.craftcx.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "Bearer": {
        "scheme": "bearer",
        "type": "http"
      }
    },
    "schemas": {},
    "parameters": {}
  },
  "paths": {
    "/v1/agents": {
      "post": {
        "description": "Create a custom AI agent that can be referenced by /assess.",
        "summary": "Create AI agent",
        "tags": [
          "Agents"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "external_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Your stable external ID from the source system for this AI agent.",
                    "example": "agent_123"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Display name for the AI agent.",
                    "example": "My OpenClaw Agent"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "custom"
                    ],
                    "description": "Agent type. Only custom agents are supported for now.",
                    "example": "custom"
                  }
                },
                "required": [
                  "external_id",
                  "name",
                  "type"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created AI agent",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "created_at": {
                      "type": "number",
                      "description": "Created at as epoch timestamp (ms).",
                      "example": 1756692778077
                    },
                    "external_id": {
                      "type": "string",
                      "description": "Your stable external ID from the source system for this AI agent.",
                      "example": "agent_123"
                    },
                    "id": {
                      "type": "string",
                      "description": "CraftCX AI Agent ID.",
                      "example": "pfh0haxfpzowht3oi213cqos"
                    },
                    "name": {
                      "type": "string",
                      "description": "Display name for the AI agent.",
                      "example": "My OpenClaw Agent"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "custom"
                      ],
                      "description": "Agent type.",
                      "example": "custom"
                    }
                  },
                  "required": [
                    "created_at",
                    "external_id",
                    "id",
                    "name",
                    "type"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "description": "A human-readable explanation specific to this occurrence of the problem."
                    },
                    "status": {
                      "type": "number",
                      "enum": [
                        400
                      ],
                      "description": "The HTTP status code generated by the origin server for this occurrence of the problem."
                    },
                    "title": {
                      "type": "string",
                      "description": "A short, human-readable summary of the problem type."
                    },
                    "type": {
                      "type": "string",
                      "format": "uri",
                      "default": "about:blank"
                    }
                  },
                  "required": [
                    "status",
                    "title"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "description": "A human-readable explanation specific to this occurrence of the problem."
                    },
                    "status": {
                      "type": "number",
                      "enum": [
                        401
                      ],
                      "description": "The HTTP status code generated by the origin server for this occurrence of the problem."
                    },
                    "title": {
                      "type": "string",
                      "description": "A short, human-readable summary of the problem type."
                    },
                    "type": {
                      "type": "string",
                      "format": "uri",
                      "default": "about:blank"
                    }
                  },
                  "required": [
                    "status",
                    "title"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "description": "A human-readable explanation specific to this occurrence of the problem."
                    },
                    "status": {
                      "type": "number",
                      "enum": [
                        409
                      ],
                      "description": "The HTTP status code generated by the origin server for this occurrence of the problem."
                    },
                    "title": {
                      "type": "string",
                      "description": "A short, human-readable summary of the problem type."
                    },
                    "type": {
                      "type": "string",
                      "format": "uri",
                      "default": "about:blank"
                    }
                  },
                  "required": [
                    "status",
                    "title"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "description": "A human-readable explanation specific to this occurrence of the problem."
                    },
                    "status": {
                      "type": "number",
                      "enum": [
                        500
                      ],
                      "description": "The HTTP status code generated by the origin server for this occurrence of the problem."
                    },
                    "title": {
                      "type": "string",
                      "description": "A short, human-readable summary of the problem type."
                    },
                    "type": {
                      "type": "string",
                      "format": "uri",
                      "default": "about:blank"
                    }
                  },
                  "required": [
                    "status",
                    "title"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v1/assess": {
      "post": {
        "description": "Send conversational message data from any source for AXIS scoring and analysis",
        "summary": "Score conversation",
        "tags": [
          "Score Conversation"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "ai_tool": {
                          "type": "string",
                          "enum": [
                            "custom",
                            "fin",
                            "front",
                            "frontAutopilot",
                            "frontAutopilotResolve",
                            "gorgias",
                            "hubspot",
                            "hubspotCustomerAgent",
                            "parahelp",
                            "zendesk",
                            "zeus"
                          ],
                          "description": "Optional AI tool or provider label for AI-authored messages. If omitted for a resolved AI Agent, CraftCX may use the AI Agent's configured tool.",
                          "example": "custom"
                        },
                        "author": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "external_id": {
                                  "type": "string",
                                  "minLength": 1,
                                  "description": "Stable contact/customer ID from the source system. Required for contact authors.",
                                  "example": "cus_123"
                                },
                                "name": {
                                  "type": "string",
                                  "minLength": 1,
                                  "description": "Display name for this provider identity. The latest non-empty value becomes its canonical display name.",
                                  "example": "Jane Customer"
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "contact"
                                  ],
                                  "description": "External customer or end user.",
                                  "example": "contact"
                                }
                              },
                              "required": [
                                "external_id",
                                "type"
                              ],
                              "description": "External customer or end user author.",
                              "title": "Contact"
                            },
                            {
                              "type": "object",
                              "properties": {
                                "external_id": {
                                  "type": "string",
                                  "minLength": 1,
                                  "description": "Stable teammate/user ID from the source system. Required for teammate authors.",
                                  "example": "tea_123"
                                },
                                "name": {
                                  "type": "string",
                                  "minLength": 1,
                                  "description": "Display name for this provider identity. The latest non-empty value becomes its canonical display name.",
                                  "example": "Jason"
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "teammate"
                                  ],
                                  "description": "Human teammate, support agent, or internal staff member.",
                                  "example": "teammate"
                                }
                              },
                              "required": [
                                "external_id",
                                "type"
                              ],
                              "description": "Human teammate, support agent, or internal staff member author.",
                              "title": "Teammate"
                            },
                            {
                              "type": "object",
                              "properties": {
                                "external_id": {
                                  "type": "string",
                                  "minLength": 1,
                                  "description": "Stable external ID for a CraftCX AI Agent record. This should match the `external_id` used when creating the AI Agent. Provide either `id` or `external_id` for AI authors.",
                                  "example": "billing-agent"
                                },
                                "id": {
                                  "type": "string",
                                  "minLength": 1,
                                  "description": "CraftCX AI Agent ID. Provide either `id` or `external_id` for AI authors. Use the [Create AI Agent](/api-reference/agents#create-ai-agent) endpoint to create an AI Agent and get the ID.",
                                  "example": "pfh0haxfpzowht3oi213cqos"
                                },
                                "name": {
                                  "type": "string",
                                  "minLength": 1,
                                  "description": "Display name for this provider identity. The latest non-empty value becomes its canonical display name.",
                                  "example": "Billing Bot"
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "ai"
                                  ],
                                  "description": "AI agent, bot, or automated assistant whose messages should be scored.",
                                  "example": "ai"
                                }
                              },
                              "required": [
                                "type"
                              ],
                              "description": "AI agent, bot, or automated assistant author.",
                              "title": "AI Agent"
                            },
                            {
                              "type": "object",
                              "properties": {
                                "external_id": {
                                  "type": "string",
                                  "minLength": 1,
                                  "description": "Optional source-system ID for the system actor or automation.",
                                  "example": "automation_rule_123"
                                },
                                "name": {
                                  "type": "string",
                                  "minLength": 1,
                                  "description": "Display name for this provider identity. The latest non-empty value becomes its canonical display name.",
                                  "example": "Zendesk Automation"
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "system"
                                  ],
                                  "description": "System event, automation, workflow, or source-system notification.",
                                  "example": "system"
                                }
                              },
                              "required": [
                                "type"
                              ],
                              "description": "System event, automation, workflow, or source-system notification author.",
                              "title": "System"
                            },
                            {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string",
                                  "minLength": 1,
                                  "description": "Optional import label. It is not stored because mixed transcript items have no individual provider identity.",
                                  "example": "Uploaded transcript"
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "mixed"
                                  ],
                                  "description": "Use when the item contains a transcript with multiple unresolved actors and the sender cannot be reliably split into individual authors.",
                                  "example": "mixed"
                                }
                              },
                              "required": [
                                "type"
                              ],
                              "description": "Transcript item with multiple unresolved authors.",
                              "title": "Mixed"
                            }
                          ],
                          "description": "The author of the message or comment. Use `contact` for external customers, `teammate` for human teammates, `ai` for AI agents, `system` for system events, and `mixed` when the item contains a transcript with multiple unresolved authors."
                        },
                        "content": {
                          "type": "string",
                          "minLength": 1,
                          "description": "The plain text body to score or include as context. Preserve enough content for CraftCX to evaluate the conversation accurately.",
                          "example": "Hello, I need help with billing."
                        },
                        "external_id": {
                          "type": "string",
                          "minLength": 1,
                          "description": "Stable message or comment ID from the source system. Must be unique within the same source, ticket, and kind.",
                          "example": "msg_123"
                        },
                        "kind": {
                          "type": "string",
                          "enum": [
                            "message",
                            "comment"
                          ],
                          "default": "message",
                          "description": "Use `message` for customer-facing transcript items and `comment` for internal notes or helpdesk comments.",
                          "example": "message"
                        },
                        "timestamp": {
                          "type": "integer",
                          "description": "Unix epoch timestamp in milliseconds for when this message or comment was created in the source system. Required so imported transcripts keep their original order.",
                          "example": 1783089291730
                        }
                      },
                      "required": [
                        "author",
                        "content",
                        "external_id",
                        "timestamp"
                      ]
                    },
                    "minItems": 1,
                    "maxItems": 50,
                    "description": "Conversation transcript items in chronological order. Each item requires `external_id`, `kind`, `content`, `author`, and `timestamp`. Use `kind=comment` for internal notes.",
                    "example": [
                      {
                        "author": {
                          "external_id": "cus_123",
                          "name": "Jane Customer",
                          "type": "contact"
                        },
                        "content": "Why was I charged twice?",
                        "external_id": "msg_1",
                        "kind": "message",
                        "timestamp": 1783088291730
                      },
                      {
                        "ai_tool": "custom",
                        "author": {
                          "external_id": "billing-agent",
                          "name": "Billing Bot",
                          "type": "ai"
                        },
                        "content": "I can help with billing.",
                        "external_id": "msg_2",
                        "kind": "message",
                        "timestamp": 1783088440817
                      },
                      {
                        "author": {
                          "external_id": "tea_123",
                          "name": "Jason",
                          "type": "teammate"
                        },
                        "content": "Escalated to billing for license review.",
                        "external_id": "note_1",
                        "kind": "comment",
                        "timestamp": 1783089090110
                      }
                    ]
                  },
                  "source": {
                    "type": "string",
                    "minLength": 1,
                    "default": "custom",
                    "description": "Source system for this import. Defaults to custom. CraftCX uses source to namespace message external_id values. Ticket imports use source_account_id when supplied, otherwise source.",
                    "example": "zendesk"
                  },
                  "source_account_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Stable account ID within the source system, such as a Zendesk subdomain or HubSpot Hub ID. When supplied, CraftCX uses it with ticket_id to identify imports and reject duplicates. Adding or changing source_account_id later creates a separate import namespace from earlier requests.",
                    "example": "acme-support"
                  },
                  "subject": {
                    "type": "string",
                    "description": "Optional ticket or conversation subject from the source system.",
                    "example": "Billing question"
                  },
                  "ticket_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Stable ticket or conversation ID from the source system. CraftCX rejects duplicate imports for the same source_account_id and ticket_id, falling back to source when source_account_id is omitted.",
                    "example": "ticket_123"
                  }
                },
                "required": [
                  "messages",
                  "ticket_id"
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "\n        The ingested event receipt. Note; we aim to \n        respond as quickly as possible, so we return a 202 Accepted \n        status code, and process the event asynchronously.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "external_ticket_id": {
                      "type": "string",
                      "description": "The ticket ID from the source system.",
                      "example": "ticket_123"
                    },
                    "id": {
                      "type": "string",
                      "description": "The CraftCX ticket ID for the accepted import.",
                      "example": "pfh0haxfpzowht3oi213cqos"
                    },
                    "source": {
                      "type": "string",
                      "description": "The source namespace used for import identity.",
                      "example": "zendesk"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "accepted"
                      ],
                      "description": "The import receipt status.",
                      "example": "accepted"
                    }
                  },
                  "required": [
                    "external_ticket_id",
                    "id",
                    "source",
                    "status"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "description": "A human-readable explanation specific to this occurrence of the problem."
                    },
                    "status": {
                      "type": "number",
                      "enum": [
                        400
                      ],
                      "description": "The HTTP status code generated by the origin server for this occurrence of the problem."
                    },
                    "title": {
                      "type": "string",
                      "description": "A short, human-readable summary of the problem type."
                    },
                    "type": {
                      "type": "string",
                      "format": "uri",
                      "default": "about:blank"
                    }
                  },
                  "required": [
                    "status",
                    "title"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "description": "A human-readable explanation specific to this occurrence of the problem."
                    },
                    "status": {
                      "type": "number",
                      "enum": [
                        401
                      ],
                      "description": "The HTTP status code generated by the origin server for this occurrence of the problem."
                    },
                    "title": {
                      "type": "string",
                      "description": "A short, human-readable summary of the problem type."
                    },
                    "type": {
                      "type": "string",
                      "format": "uri",
                      "default": "about:blank"
                    }
                  },
                  "required": [
                    "status",
                    "title"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "description": "A human-readable explanation specific to this occurrence of the problem."
                    },
                    "status": {
                      "type": "number",
                      "enum": [
                        404
                      ],
                      "description": "The HTTP status code generated by the origin server for this occurrence of the problem."
                    },
                    "title": {
                      "type": "string",
                      "description": "A short, human-readable summary of the problem type."
                    },
                    "type": {
                      "type": "string",
                      "format": "uri",
                      "default": "about:blank"
                    }
                  },
                  "required": [
                    "status",
                    "title"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "description": "A human-readable explanation specific to this occurrence of the problem."
                    },
                    "status": {
                      "type": "number",
                      "enum": [
                        409
                      ],
                      "description": "The HTTP status code generated by the origin server for this occurrence of the problem."
                    },
                    "title": {
                      "type": "string",
                      "description": "A short, human-readable summary of the problem type."
                    },
                    "type": {
                      "type": "string",
                      "format": "uri",
                      "default": "about:blank"
                    }
                  },
                  "required": [
                    "status",
                    "title"
                  ]
                }
              }
            }
          },
          "413": {
            "description": "Request entity too large",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "description": "A human-readable explanation specific to this occurrence of the problem."
                    },
                    "status": {
                      "type": "number",
                      "enum": [
                        413
                      ],
                      "description": "The HTTP status code generated by the origin server for this occurrence of the problem."
                    },
                    "title": {
                      "type": "string",
                      "description": "A short, human-readable summary of the problem type."
                    },
                    "type": {
                      "type": "string",
                      "format": "uri",
                      "default": "about:blank"
                    }
                  },
                  "required": [
                    "status",
                    "title"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "description": "A human-readable explanation specific to this occurrence of the problem."
                    },
                    "status": {
                      "type": "number",
                      "enum": [
                        500
                      ],
                      "description": "The HTTP status code generated by the origin server for this occurrence of the problem."
                    },
                    "title": {
                      "type": "string",
                      "description": "A short, human-readable summary of the problem type."
                    },
                    "type": {
                      "type": "string",
                      "format": "uri",
                      "default": "about:blank"
                    }
                  },
                  "required": [
                    "status",
                    "title"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v1/evaluations/exports": {
      "post": {
        "description": "Queue an evaluation export job",
        "summary": "Create evaluation export",
        "tags": [
          "Export Data"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "filters": {
                    "type": "object",
                    "properties": {
                      "from": {
                        "type": "integer",
                        "minimum": 0,
                        "exclusiveMinimum": true,
                        "description": "Unix timestamp (milliseconds) for the start of the export window"
                      },
                      "to": {
                        "type": "integer",
                        "minimum": 0,
                        "exclusiveMinimum": true,
                        "description": "Unix timestamp (milliseconds) for the end of the export window"
                      }
                    },
                    "required": [
                      "from",
                      "to"
                    ],
                    "description": "Supported filters for the export"
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "csv"
                    ],
                    "description": "The export format"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "axis"
                    ],
                    "description": "The evaluation export type"
                  }
                },
                "required": [
                  "filters",
                  "format",
                  "kind"
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The queued evaluation export job",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "created_at": {
                      "type": "number",
                      "description": "Epoch timestamp (milliseconds) for when the export was created"
                    },
                    "download_url": {
                      "type": "string",
                      "nullable": true,
                      "format": "uri",
                      "description": "Download URL for the completed export"
                    },
                    "error_message": {
                      "type": "string",
                      "nullable": true,
                      "description": "A human-readable error if the export failed"
                    },
                    "filters": {
                      "type": "object",
                      "properties": {
                        "from": {
                          "type": "integer",
                          "minimum": 0,
                          "exclusiveMinimum": true,
                          "description": "Unix timestamp (milliseconds) for the start of the export window"
                        },
                        "to": {
                          "type": "integer",
                          "minimum": 0,
                          "exclusiveMinimum": true,
                          "description": "Unix timestamp (milliseconds) for the end of the export window"
                        }
                      },
                      "required": [
                        "from",
                        "to"
                      ],
                      "description": "Filters applied to the export"
                    },
                    "format": {
                      "type": "string",
                      "enum": [
                        "csv"
                      ],
                      "description": "The export format"
                    },
                    "id": {
                      "type": "string",
                      "description": "The export ID"
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "axis",
                        "resolution_audit"
                      ],
                      "description": "The evaluation export type"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "running",
                        "complete",
                        "failed"
                      ],
                      "description": "The status of the export"
                    },
                    "updated_at": {
                      "type": "number",
                      "description": "Epoch timestamp (milliseconds) for when the export was last updated"
                    }
                  },
                  "required": [
                    "created_at",
                    "download_url",
                    "filters",
                    "format",
                    "id",
                    "kind",
                    "status",
                    "updated_at"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "description": "A human-readable explanation specific to this occurrence of the problem."
                    },
                    "status": {
                      "type": "number",
                      "enum": [
                        400
                      ],
                      "description": "The HTTP status code generated by the origin server for this occurrence of the problem."
                    },
                    "title": {
                      "type": "string",
                      "description": "A short, human-readable summary of the problem type."
                    },
                    "type": {
                      "type": "string",
                      "format": "uri",
                      "default": "about:blank"
                    }
                  },
                  "required": [
                    "status",
                    "title"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "description": "A human-readable explanation specific to this occurrence of the problem."
                    },
                    "status": {
                      "type": "number",
                      "enum": [
                        401
                      ],
                      "description": "The HTTP status code generated by the origin server for this occurrence of the problem."
                    },
                    "title": {
                      "type": "string",
                      "description": "A short, human-readable summary of the problem type."
                    },
                    "type": {
                      "type": "string",
                      "format": "uri",
                      "default": "about:blank"
                    }
                  },
                  "required": [
                    "status",
                    "title"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "description": "A human-readable explanation specific to this occurrence of the problem."
                    },
                    "status": {
                      "type": "number",
                      "enum": [
                        500
                      ],
                      "description": "The HTTP status code generated by the origin server for this occurrence of the problem."
                    },
                    "title": {
                      "type": "string",
                      "description": "A short, human-readable summary of the problem type."
                    },
                    "type": {
                      "type": "string",
                      "format": "uri",
                      "default": "about:blank"
                    }
                  },
                  "required": [
                    "status",
                    "title"
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "description": "Retrieve evaluation exports for the organization with pagination",
        "summary": "List evaluation exports",
        "tags": [
          "Export Data"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "description": "Opaque cursor returned from a previous request",
              "example": "eyJpZCI6Inh5eiJ9"
            },
            "required": false,
            "description": "Opaque cursor returned from a previous request",
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10,
              "description": "Maximum number of items to return",
              "example": 10
            },
            "required": false,
            "description": "Maximum number of items to return",
            "name": "limit",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated evaluation exports",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "created_at": {
                            "type": "number",
                            "description": "Epoch timestamp (milliseconds) for when the export was created"
                          },
                          "download_url": {
                            "type": "string",
                            "nullable": true,
                            "format": "uri",
                            "description": "Download URL for the completed export"
                          },
                          "error_message": {
                            "type": "string",
                            "nullable": true,
                            "description": "A human-readable error if the export failed"
                          },
                          "filters": {
                            "type": "object",
                            "properties": {
                              "from": {
                                "type": "integer",
                                "minimum": 0,
                                "exclusiveMinimum": true,
                                "description": "Unix timestamp (milliseconds) for the start of the export window"
                              },
                              "to": {
                                "type": "integer",
                                "minimum": 0,
                                "exclusiveMinimum": true,
                                "description": "Unix timestamp (milliseconds) for the end of the export window"
                              }
                            },
                            "required": [
                              "from",
                              "to"
                            ],
                            "description": "Filters applied to the export"
                          },
                          "format": {
                            "type": "string",
                            "enum": [
                              "csv"
                            ],
                            "description": "The export format"
                          },
                          "id": {
                            "type": "string",
                            "description": "The export ID"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "axis",
                              "resolution_audit"
                            ],
                            "description": "The evaluation export type"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "pending",
                              "running",
                              "complete",
                              "failed"
                            ],
                            "description": "The status of the export"
                          },
                          "updated_at": {
                            "type": "number",
                            "description": "Epoch timestamp (milliseconds) for when the export was last updated"
                          }
                        },
                        "required": [
                          "created_at",
                          "download_url",
                          "filters",
                          "format",
                          "id",
                          "kind",
                          "status",
                          "updated_at"
                        ]
                      }
                    },
                    "page_info": {
                      "type": "object",
                      "properties": {
                        "has_next_page": {
                          "type": "boolean"
                        },
                        "limit": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 100
                        },
                        "next_cursor": {
                          "type": "string",
                          "nullable": true
                        }
                      },
                      "required": [
                        "has_next_page",
                        "limit",
                        "next_cursor"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "page_info"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "description": "A human-readable explanation specific to this occurrence of the problem."
                    },
                    "status": {
                      "type": "number",
                      "enum": [
                        400
                      ],
                      "description": "The HTTP status code generated by the origin server for this occurrence of the problem."
                    },
                    "title": {
                      "type": "string",
                      "description": "A short, human-readable summary of the problem type."
                    },
                    "type": {
                      "type": "string",
                      "format": "uri",
                      "default": "about:blank"
                    }
                  },
                  "required": [
                    "status",
                    "title"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "description": "A human-readable explanation specific to this occurrence of the problem."
                    },
                    "status": {
                      "type": "number",
                      "enum": [
                        401
                      ],
                      "description": "The HTTP status code generated by the origin server for this occurrence of the problem."
                    },
                    "title": {
                      "type": "string",
                      "description": "A short, human-readable summary of the problem type."
                    },
                    "type": {
                      "type": "string",
                      "format": "uri",
                      "default": "about:blank"
                    }
                  },
                  "required": [
                    "status",
                    "title"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "description": "A human-readable explanation specific to this occurrence of the problem."
                    },
                    "status": {
                      "type": "number",
                      "enum": [
                        500
                      ],
                      "description": "The HTTP status code generated by the origin server for this occurrence of the problem."
                    },
                    "title": {
                      "type": "string",
                      "description": "A short, human-readable summary of the problem type."
                    },
                    "type": {
                      "type": "string",
                      "format": "uri",
                      "default": "about:blank"
                    }
                  },
                  "required": [
                    "status",
                    "title"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v1/evaluations/exports/{exportId}": {
      "get": {
        "description": "Retrieve the status of an evaluation export job",
        "summary": "Get evaluation export",
        "tags": [
          "Export Data"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "The export ID"
            },
            "required": true,
            "description": "The export ID",
            "name": "exportId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "The evaluation export job details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "created_at": {
                      "type": "number",
                      "description": "Epoch timestamp (milliseconds) for when the export was created"
                    },
                    "download_url": {
                      "type": "string",
                      "nullable": true,
                      "format": "uri",
                      "description": "Download URL for the completed export"
                    },
                    "error_message": {
                      "type": "string",
                      "nullable": true,
                      "description": "A human-readable error if the export failed"
                    },
                    "filters": {
                      "type": "object",
                      "properties": {
                        "from": {
                          "type": "integer",
                          "minimum": 0,
                          "exclusiveMinimum": true,
                          "description": "Unix timestamp (milliseconds) for the start of the export window"
                        },
                        "to": {
                          "type": "integer",
                          "minimum": 0,
                          "exclusiveMinimum": true,
                          "description": "Unix timestamp (milliseconds) for the end of the export window"
                        }
                      },
                      "required": [
                        "from",
                        "to"
                      ],
                      "description": "Filters applied to the export"
                    },
                    "format": {
                      "type": "string",
                      "enum": [
                        "csv"
                      ],
                      "description": "The export format"
                    },
                    "id": {
                      "type": "string",
                      "description": "The export ID"
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "axis",
                        "resolution_audit"
                      ],
                      "description": "The evaluation export type"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "running",
                        "complete",
                        "failed"
                      ],
                      "description": "The status of the export"
                    },
                    "updated_at": {
                      "type": "number",
                      "description": "Epoch timestamp (milliseconds) for when the export was last updated"
                    }
                  },
                  "required": [
                    "created_at",
                    "download_url",
                    "filters",
                    "format",
                    "id",
                    "kind",
                    "status",
                    "updated_at"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "description": "A human-readable explanation specific to this occurrence of the problem."
                    },
                    "status": {
                      "type": "number",
                      "enum": [
                        401
                      ],
                      "description": "The HTTP status code generated by the origin server for this occurrence of the problem."
                    },
                    "title": {
                      "type": "string",
                      "description": "A short, human-readable summary of the problem type."
                    },
                    "type": {
                      "type": "string",
                      "format": "uri",
                      "default": "about:blank"
                    }
                  },
                  "required": [
                    "status",
                    "title"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "description": "A human-readable explanation specific to this occurrence of the problem."
                    },
                    "status": {
                      "type": "number",
                      "enum": [
                        404
                      ],
                      "description": "The HTTP status code generated by the origin server for this occurrence of the problem."
                    },
                    "title": {
                      "type": "string",
                      "description": "A short, human-readable summary of the problem type."
                    },
                    "type": {
                      "type": "string",
                      "format": "uri",
                      "default": "about:blank"
                    }
                  },
                  "required": [
                    "status",
                    "title"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "description": "A human-readable explanation specific to this occurrence of the problem."
                    },
                    "status": {
                      "type": "number",
                      "enum": [
                        500
                      ],
                      "description": "The HTTP status code generated by the origin server for this occurrence of the problem."
                    },
                    "title": {
                      "type": "string",
                      "description": "A short, human-readable summary of the problem type."
                    },
                    "type": {
                      "type": "string",
                      "format": "uri",
                      "default": "about:blank"
                    }
                  },
                  "required": [
                    "status",
                    "title"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v1/evaluations/exports/{id}/download": {
      "get": {
        "description": "Redirect to the signed URL for a completed export. If Accept: application/json is sent, returns JSON with the download_url instead.",
        "summary": "Download evaluation export",
        "tags": [
          "Export Data"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "The export ID"
            },
            "required": true,
            "description": "The export ID",
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "JSON response with download URL (when Accept: application/json is sent)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "download_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Signed URL to download the export"
                    }
                  },
                  "required": [
                    "download_url"
                  ]
                }
              }
            }
          },
          "302": {
            "description": "Redirect to the signed download URL (default behavior for `fetch` requests)"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "description": "A human-readable explanation specific to this occurrence of the problem."
                    },
                    "status": {
                      "type": "number",
                      "enum": [
                        401
                      ],
                      "description": "The HTTP status code generated by the origin server for this occurrence of the problem."
                    },
                    "title": {
                      "type": "string",
                      "description": "A short, human-readable summary of the problem type."
                    },
                    "type": {
                      "type": "string",
                      "format": "uri",
                      "default": "about:blank"
                    }
                  },
                  "required": [
                    "status",
                    "title"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "description": "A human-readable explanation specific to this occurrence of the problem."
                    },
                    "status": {
                      "type": "number",
                      "enum": [
                        404
                      ],
                      "description": "The HTTP status code generated by the origin server for this occurrence of the problem."
                    },
                    "title": {
                      "type": "string",
                      "description": "A short, human-readable summary of the problem type."
                    },
                    "type": {
                      "type": "string",
                      "format": "uri",
                      "default": "about:blank"
                    }
                  },
                  "required": [
                    "status",
                    "title"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "description": "A human-readable explanation specific to this occurrence of the problem."
                    },
                    "status": {
                      "type": "number",
                      "enum": [
                        409
                      ],
                      "description": "The HTTP status code generated by the origin server for this occurrence of the problem."
                    },
                    "title": {
                      "type": "string",
                      "description": "A short, human-readable summary of the problem type."
                    },
                    "type": {
                      "type": "string",
                      "format": "uri",
                      "default": "about:blank"
                    }
                  },
                  "required": [
                    "status",
                    "title"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "description": "A human-readable explanation specific to this occurrence of the problem."
                    },
                    "status": {
                      "type": "number",
                      "enum": [
                        500
                      ],
                      "description": "The HTTP status code generated by the origin server for this occurrence of the problem."
                    },
                    "title": {
                      "type": "string",
                      "description": "A short, human-readable summary of the problem type."
                    },
                    "type": {
                      "type": "string",
                      "format": "uri",
                      "default": "about:blank"
                    }
                  },
                  "required": [
                    "status",
                    "title"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v1/tickets/{id}": {
      "get": {
        "description": "Get a ticket by ID",
        "summary": "Get ticket",
        "tags": [
          "Tickets"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "The ID of the evaluation run",
              "example": "pfh0haxfpzowht3oi213cqos"
            },
            "required": true,
            "description": "The ID of the evaluation run",
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "High level information about a ticket",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "created_at": {
                      "type": "number",
                      "description": "The created at of the ticket as an Epoch timestamp at millisecond granularity",
                      "example": 1756692778077
                    },
                    "external_id": {
                      "type": "string",
                      "description": "The external ID of the ticket",
                      "example": "1234567890"
                    },
                    "id": {
                      "type": "string",
                      "description": "The ID of the ingested event",
                      "example": "pfh0haxfpzowht3oi213cqos"
                    },
                    "subject": {
                      "type": "string",
                      "nullable": true,
                      "description": "The subject of the ticket",
                      "example": "Test ticket"
                    }
                  },
                  "required": [
                    "created_at",
                    "external_id",
                    "id",
                    "subject"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "description": "A human-readable explanation specific to this occurrence of the problem."
                    },
                    "status": {
                      "type": "number",
                      "enum": [
                        404
                      ],
                      "description": "The HTTP status code generated by the origin server for this occurrence of the problem."
                    },
                    "title": {
                      "type": "string",
                      "description": "A short, human-readable summary of the problem type."
                    },
                    "type": {
                      "type": "string",
                      "format": "uri",
                      "default": "about:blank"
                    }
                  },
                  "required": [
                    "status",
                    "title"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "description": "A human-readable explanation specific to this occurrence of the problem."
                    },
                    "status": {
                      "type": "number",
                      "enum": [
                        500
                      ],
                      "description": "The HTTP status code generated by the origin server for this occurrence of the problem."
                    },
                    "title": {
                      "type": "string",
                      "description": "A short, human-readable summary of the problem type."
                    },
                    "type": {
                      "type": "string",
                      "format": "uri",
                      "default": "about:blank"
                    }
                  },
                  "required": [
                    "status",
                    "title"
                  ]
                }
              }
            }
          }
        }
      }
    }
  }
}
