Create a production Spool (the agreement object) from structured terms and acceptance criteria. Use when both parties will participate in the agreement lifecycle; do not use for one-call unilateral verification. This persists a proposed agreement and may send the counterparty invite reported in the response handoff block. The type field defaults to the person or business service path, while agent selects the agent settlement rail. Conditions may declare verification_method third_party with an external_judge so verification consumes your own evaluator's bound result instead of Spoolis judging those conditions. Production only: set SPOOLIS_API_KEY; not available in the no-key sandbox.
View input schema
{
"type": "object",
"properties": {
"gated_action": {
"nullable": true,
"type": "string",
"enum": [
"payment",
"workflow_step",
"publish",
"merge",
"delegation",
"other"
]
},
"gated_action_note": {
"nullable": true,
"type": "string",
"maxLength": 120
},
"agreement": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"bilateral",
"unilateral"
]
}
},
"required": [
"mode"
],
"additionalProperties": false
},
"type": {
"default": "service",
"type": "string",
"enum": [
"goods_in_person",
"service",
"digital",
"agent_task"
]
},
"parties": {
"minItems": 2,
"maxItems": 2,
"type": "array",
"items": {
"type": "object",
"properties": {
"role": {
"type": "string",
"enum": [
"buyer",
"seller",
"client",
"provider"
]
},
"kind": {
"type": "string",
"enum": [
"human",
"agent",
"org",
"service"
]
},
"display_name": {
"type": "string",
"minLength": 1,
"maxLength": 120
},
"contact": {
"type": "string",
"maxLength": 300
},
"account_id": {
"type": "string",
"maxLength": 200
},
"settlement_address": {
"type": "string",
"pattern": "^(?:wallet:eip155:(?:8453|42431):)?0x[a-fA-F0-9]{40}$"
},
"stripe_account_id": {
"type": "string",
"pattern": "^acct_.*"
}
},
"required": [
"role",
"kind",
"display_name"
],
"additionalProperties": false
}
},
"value": {
"type": "object",
"properties": {
"amount_cents": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"currency": {
"type": "string",
"const": "USD"
},
"rail_preference": {
"type": "string",
"maxLength": 100
}
},
"required": [
"amount_cents",
"currency"
],
"additionalProperties": false
},
"deliverable": {
"type": "object",
"properties": {
"type": {
"type": "string",
"minLength": 1
},
"title": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string"
},
"attributes": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"type": "string"
}
}
},
"required": [
"type",
"title",
"description",
"attributes"
],
"additionalProperties": false
},
"terms": {
"minItems": 1,
"maxItems": 50,
"type": "array",
"items": {
"type": "object",
"properties": {
"text": {
"type": "string",
"minLength": 1,
"maxLength": 2000
},
"provenance": {
"type": "object",
"properties": {
"source": {
"type": "string",
"enum": [
"listing",
"chat",
"image",
"freeform",
"user_added"
]
},
"source_ref": {
"type": "string",
"maxLength": 500
},
"origin": {
"type": "string",
"enum": [
"extracted",
"inferred",
"spoolis_proposed",
"user_added",
"user_edited",
"mutually_agreed"
]
}
},
"required": [
"source"
],
"additionalProperties": false
}
},
"required": [
"text",
"provenance"
],
"additionalProperties": false
}
},
"conditions": {
"maxItems": 50,
"type": "array",
"items": {
"type": "object",
"properties": {
"description": {
"type": "string",
"minLength": 1,
"maxLength": 2000
},
"required": {
"type": "boolean"
},
"verification_method": {
"type": "string",
"enum": [
"buyer_confirm",
"both_confirm",
"deterministic",
"ai_assisted",
"third_party"
]
},
"deterministic_check": {
"oneOf": [
{
"type": "object",
"properties": {
"checker": {
"type": "string",
"const": "row_count"
},
"expected": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"checker",
"expected"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"checker": {
"type": "string",
"const": "completeness"
},
"required_fields": {
"minItems": 1,
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
}
},
"required": [
"checker",
"required_fields"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"checker": {
"type": "string",
"const": "duplicate_rate"
},
"key": {
"type": "string",
"minLength": 1
},
"maximum": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"checker",
"key",
"maximum"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"checker": {
"type": "string",
"const": "url_format"
},
"field": {
"type": "string",
"minLength": 1
}
},
"required": [
"checker",
"field"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"checker": {
"type": "string",
"const": "json_path"
},
"path": {
"type": "string",
"minLength": 1
},
"expected": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
}
]
},
"operator": {
"type": "string",
"enum": [
"eq",
"gte",
"lte",
"contains"
]
}
},
"required": [
"checker",
"path",
"expected",
"operator"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"checker": {
"type": "string",
"const": "http_status"
},
"url": {
"type": "string",
"format": "uri"
},
"expected_status": {
"type": "integer",
"minimum": 100,
"maximum": 599
},
"timeout_ms": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 5000
}
},
"required": [
"checker",
"url",
"expected_status"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"checker": {
"type": "string",
"const": "text_contains"
},
"needle": {
"type": "string",
"minLength": 1
},
"case_sensitive": {
"type": "boolean"
},
"field": {
"type": "string",
"minLength": 1
}
},
"required": [
"checker",
"needle"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"checker": {
"type": "string",
"const": "hash_matches"
},
"algorithm": {
"type": "string",
"const": "sha256"
},
"expected": {
"type": "string",
"pattern": "^[a-fA-F0-9]{64}$"
}
},
"required": [
"checker",
"algorithm",
"expected"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"checker": {
"type": "string",
"const": "deadline_met"
},
"due_at": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
}
},
"required": [
"checker",
"due_at"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"checker": {
"type": "string",
"const": "claim_cited"
},
"claim": {
"type": "string",
"minLength": 1,
"maxLength": 2000
},
"evidence_ref": {
"type": "string",
"pattern": "^evd_.*"
}
},
"required": [
"checker",
"claim"
],
"additionalProperties": false
}
]
},
"evidence_requirements": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"expected_type": {
"type": "string",
"minLength": 1
},
"source": {
"type": "object",
"properties": {
"ref": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string"
}
},
"required": [
"ref"
],
"additionalProperties": false
},
"provenance": {
"type": "object",
"properties": {
"min_class": {
"type": "string",
"enum": [
"submitted_by_provider",
"submitted_by_buyer",
"fetched_by_spoolis",
"signed_by_external_system",
"confirmed_by_human",
"unknown_origin"
]
},
"independent_of": {
"type": "string",
"enum": [
"provider",
"buyer"
]
}
},
"additionalProperties": false
},
"who_may_supply": {
"type": "array",
"items": {
"type": "string",
"enum": [
"provider",
"buyer",
"spoolis",
"external_system",
"human"
]
}
},
"freshness_seconds": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"on_missing": {
"type": "string",
"enum": [
"uncertain",
"fail"
]
}
},
"required": [
"id",
"expected_type",
"source"
],
"additionalProperties": false
}
},
"external_judge": {
"type": "object",
"properties": {
"evaluator_id": {
"type": "string",
"minLength": 1,
"maxLength": 500
},
"kind": {
"type": "string",
"enum": [
"external_service",
"zk_verifier",
"marketplace_evaluator",
"buyer_owned",
"ai_evaluator",
"human_arbitration"
]
},
"evaluator_version": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"proof_requirement": {
"type": "string",
"enum": [
"signed",
"hashed_ref",
"declared"
]
},
"on_missing": {
"type": "string",
"enum": [
"uncertain",
"fail"
]
},
"public_key": {
"type": "string",
"minLength": 1,
"maxLength": 10000
},
"score_mapping": {
"type": "object",
"properties": {
"schema_id": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"quality_gte": {
"type": "integer",
"minimum": 0,
"maximum": 100
},
"consensus_gte": {
"type": "integer",
"minimum": 0,
"maximum": 100
}
},
"required": [
"schema_id",
"quality_gte",
"consensus_gte"
],
"additionalProperties": false
}
},
"required": [
"evaluator_id",
"kind",
"proof_requirement"
],
"additionalProperties": false
}
},
"required": [
"description",
"required",
"verification_method"
],
"additionalProperties": false
}
},
"economics": {
"type": "object",
"properties": {
"fee_cents": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"expiry": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
},
"unitization": {
"type": "object",
"properties": {
"total_units": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 100000
},
"unit_amount_cents": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"identity": {
"type": "object",
"properties": {
"key": {
"type": "string",
"minLength": 1
},
"visibility": {
"type": "string",
"enum": [
"label",
"pseudonymous"
]
}
},
"required": [
"key",
"visibility"
],
"additionalProperties": false
}
},
"required": [
"total_units",
"unit_amount_cents"
],
"additionalProperties": false
},
"capture_policy": {
"type": "object",
"properties": {
"auto_capture": {
"type": "array",
"items": {
"type": "string",
"const": "grounded"
}
}
},
"required": [
"auto_capture"
],
"additionalProperties": false
}
},
"additionalProperties": false
},
"dispute_policy": {
"type": "object",
"properties": {
"who_may_dispute": {
"minItems": 1,
"type": "array",
"items": {
"type": "string",
"enum": [
"buyer",
"provider"
]
}
},
"window_seconds": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"scope": {
"type": "string",
"enum": [
"units",
"outcome"
]
},
"on_dispute": {
"type": "string",
"enum": [
"freeze_disputed_value",
"freeze_all"
]
},
"new_evidence": {
"type": "string",
"enum": [
"allowed",
"not_allowed"
]
},
"escalation": {
"oneOf": [
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "reverify"
}
},
"required": [
"kind"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "external_judge"
},
"ref": {
"type": "string",
"minLength": 1
}
},
"required": [
"kind",
"ref"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "none"
}
},
"required": [
"kind"
],
"additionalProperties": false
}
]
},
"finality": {
"type": "string",
"enum": [
"escalation_is_final",
"unresolved_stays_disputed"
]
}
},
"required": [
"who_may_dispute",
"window_seconds",
"scope",
"on_dispute",
"new_evidence",
"escalation",
"finality"
],
"additionalProperties": false
},
"finality": {
"type": "object",
"properties": {
"window": {
"type": "object",
"properties": {
"after": {
"type": "string",
"enum": [
"acceptance",
"evidence",
"period_end"
]
},
"duration_iso8601": {
"type": "string",
"pattern": "^P(?=\\d|T\\d)"
}
},
"required": [
"after",
"duration_iso8601"
],
"additionalProperties": false
},
"reopen": {
"type": "object",
"properties": {
"allowed": {
"type": "boolean"
},
"by": {
"type": "array",
"items": {
"type": "string",
"enum": [
"buyer",
"provider",
"third_party"
]
}
},
"until": {
"type": "string",
"enum": [
"final",
"never"
]
}
},
"required": [
"allowed",
"by",
"until"
],
"additionalProperties": false
},
"correction": {
"type": "object",
"properties": {
"allowed": {
"type": "boolean"
},
"requires_authority": {
"type": "boolean"
}
},
"required": [
"allowed",
"requires_authority"
],
"additionalProperties": false
},
"on_silence": {
"type": "string",
"enum": [
"keep",
"hold",
"reject"
]
}
},
"required": [
"window",
"reopen",
"correction",
"on_silence"
],
"additionalProperties": false
}
},
"required": [
"parties",
"value",
"deliverable",
"terms",
"conditions"
],
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false
}