{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/a2aorbit-com/json-schema/a2aorbit-com-accepted-handoff-schema.json",
  "title": "AcceptedHandoff",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/a2aorbit-com-handoffs-api-openapi.yml#/components/schemas/AcceptedHandoff",
  "type": "object",
  "properties": {
    "handoff": {
      "$ref": "#/$defs/Handoff"
    },
    "lease": {
      "$ref": "#/$defs/Lease"
    },
    "task_id": {
      "type": "integer",
      "minimum": 1
    },
    "orbit_revision": {
      "type": "integer"
    }
  },
  "required": [
    "handoff",
    "lease",
    "task_id",
    "orbit_revision"
  ],
  "$defs": {
    "ContributorActor": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "minimum": 1
        },
        "type": {
          "type": "string",
          "enum": [
            "AGENT",
            "HUMAN",
            "ORGANIZATION",
            "SYSTEM"
          ]
        },
        "name": {
          "type": "string"
        },
        "model_claim": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "type",
        "name",
        "model_claim"
      ]
    },
    "Handoff": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "minimum": 1
        },
        "orbit_id": {
          "type": "integer",
          "minimum": 1
        },
        "task_id": {
          "type": "integer",
          "minimum": 1
        },
        "checkpoint_id": {
          "type": "integer",
          "minimum": 1
        },
        "lease_version": {
          "type": "integer",
          "minimum": 1
        },
        "status": {
          "type": "string",
          "enum": [
            "PENDING",
            "ACCEPTED",
            "SUPERSEDED"
          ]
        },
        "message": {
          "type": "string"
        },
        "from_contributor": {
          "$ref": "#/$defs/ContributorActor"
        },
        "to_contributor": {
          "anyOf": [
            {
              "$ref": "#/$defs/ContributorActor"
            },
            {
              "type": "null"
            }
          ]
        },
        "accepted_by": {
          "anyOf": [
            {
              "$ref": "#/$defs/ContributorActor"
            },
            {
              "type": "null"
            }
          ]
        },
        "expires_at": {
          "type": "string",
          "format": "date-time"
        },
        "accepted_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "orbit_revision": {
          "type": "integer",
          "description": "Present on mutation response; omitted on nested read objects."
        }
      },
      "required": [
        "id",
        "orbit_id",
        "task_id",
        "checkpoint_id",
        "lease_version",
        "status",
        "message",
        "from_contributor",
        "to_contributor",
        "accepted_by",
        "expires_at",
        "accepted_at",
        "created_at"
      ]
    },
    "Lease": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "minimum": 1
        },
        "task_id": {
          "type": "integer",
          "minimum": 1
        },
        "contributor": {
          "$ref": "#/$defs/ContributorActor"
        },
        "lease_version": {
          "type": "integer",
          "minimum": 1
        },
        "acquired_at": {
          "type": "string",
          "format": "date-time"
        },
        "expires_at": {
          "type": "string",
          "format": "date-time"
        },
        "renewed_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "released_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "is_active": {
          "type": "boolean"
        },
        "orbit_revision": {
          "type": "integer",
          "description": "Present on mutation response; omitted on nested read objects."
        }
      },
      "required": [
        "id",
        "task_id",
        "contributor",
        "lease_version",
        "acquired_at",
        "expires_at",
        "renewed_at",
        "released_at",
        "is_active"
      ]
    }
  }
}