{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/scale-ai/json-schema/scale-ai-create-span-request-schema.json",
  "title": "CreateSpanRequest",
  "x-generated": "2026-10-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/scale-ai-agentex-openapi.yml#/components/schemas/CreateSpanRequest",
  "properties": {
    "id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Unique Span ID",
      "description": "Unique identifier for the span. If not provided, an ID will be generated."
    },
    "trace_id": {
      "type": "string",
      "title": "The trace ID for this span",
      "description": "Unique identifier for the trace this span belongs to"
    },
    "task_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "The task ID this span is associated with",
      "description": "ID of the task this span belongs to"
    },
    "parent_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "The parent span ID if this is a child span",
      "description": "ID of the parent span if this is a child span in a trace"
    },
    "name": {
      "type": "string",
      "title": "The name of the span",
      "description": "Name that describes what operation this span represents"
    },
    "start_time": {
      "type": "string",
      "format": "date-time",
      "title": "The start time of the span",
      "description": "The time the span started"
    },
    "end_time": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "The end time of the span",
      "description": "The time the span ended"
    },
    "input": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "The input data for the span",
      "description": "Input parameters or data for the operation"
    },
    "output": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "The output data from the span",
      "description": "Output data resulting from the operation"
    },
    "data": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Additional data associated with the span",
      "description": "Any additional metadata or context for the span"
    }
  },
  "type": "object",
  "required": [
    "trace_id",
    "name",
    "start_time"
  ]
}