{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/detectif-ai/json-schema/detectif-ai-operation-object-schema.json",
  "title": "OperationObject",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/detectif-ai-api-openapi.json#/components/schemas/OperationObject",
  "properties": {
    "request_id": {
      "type": "string",
      "title": "Request Id"
    },
    "object": {
      "type": "string",
      "const": "operation",
      "title": "Object"
    },
    "operation_id": {
      "type": "string",
      "title": "Operation Id"
    },
    "type": {
      "type": "string",
      "enum": [
        "deepfake.detect",
        "speaker.enroll",
        "speaker.verify",
        "noesis.stream",
        "noesis.file"
      ],
      "title": "Type"
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "reserved",
        "running",
        "succeeded",
        "failed"
      ],
      "title": "Status"
    },
    "source": {
      "type": "string",
      "enum": [
        "api",
        "dashboard",
        "mcp",
        "x_bot"
      ],
      "title": "Source"
    },
    "parent_operation_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Parent Operation Id"
    },
    "credits_charged": {
      "type": "integer",
      "title": "Credits Charged"
    },
    "created_at": {
      "type": "string",
      "title": "Created At"
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Completed At"
    },
    "result": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Result",
      "description": "The original success response body (without request_id)."
    },
    "error": {
      "anyOf": [
        {
          "$ref": "#/$defs/ErrorDetail"
        },
        {
          "type": "null"
        }
      ]
    },
    "partial": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Partial",
      "description": "For a failed verification whose synthetic-speech check completed: that result."
    }
  },
  "type": "object",
  "required": [
    "request_id",
    "object",
    "operation_id",
    "type",
    "status",
    "source",
    "parent_operation_id",
    "credits_charged",
    "created_at",
    "completed_at",
    "result",
    "error"
  ],
  "$defs": {
    "ErrorDetail": {
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "invalid_request",
            "authentication",
            "permission",
            "not_found",
            "conflict",
            "rate_limited",
            "insufficient_credits",
            "payload_too_large",
            "unsupported_media",
            "unprocessable_audio",
            "overloaded",
            "internal"
          ],
          "title": "Type"
        },
        "code": {
          "type": "string",
          "title": "Code",
          "description": "Stable snake_case error code."
        },
        "message": {
          "type": "string",
          "title": "Message",
          "description": "Human-readable explanation. Do not parse."
        },
        "param": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Param",
          "description": "The request field the error refers to, if any."
        }
      },
      "type": "object",
      "required": [
        "type",
        "code",
        "message"
      ],
      "title": "ErrorDetail"
    }
  }
}