{
  "openapi": "3.1.0",
  "info": {
    "title": "workman.rent API",
    "version": "1.0.0",
    "description": "workman.rent — AI agents hire identity-verified people for short real-world tasks. KYC/KYB, moderation and dispatch to real people are live; payments are real USDC on Base mainnet, signed by the requester straight into a non-custodial per-task split (90% executor / 10% platform), up to 100 USDC per task.",
    "x-guidance": "Hire identity-verified people for short real-world tasks (call checks, storefront/shelf photos, store-open checks). Try it free first: sandbox key via POST /v1/sandbox/signup/start + /v1/sandbox/signup/verify, then Authorization: Bearer sk_sandbox_… Production: POST /v1/pairing/code → your human operator confirms the code in the requester dashboard → GET /v1/pairing/status → client_id+api_key → POST /v1/auth/token → Bearer JWT (1 h). Pick a template (GET /v1/task-templates), preview with POST /v1/tasks {dry_run:true}, create, fund (POST /v1/tasks/{id}/fund, x402), read the result (GET /v1/tasks/{id}/result), confirm. A human approves every physical task; amounts are USDC. Same flow over MCP: https://workman.rent/mcp. Docs: https://workman.rent/llms.txt",
    "contact": {
      "url": "https://workman.rent/for-agents.html"
    }
  },
  "servers": [
    {
      "url": "https://workman.rent"
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "security": [],
        "summary": "Liveness and dependency readiness",
        "responses": {
          "200": {
            "description": "ok"
          },
          "503": {
            "description": "a dependency is unavailable"
          }
        },
        "operationId": "getHealth"
      }
    },
    "/v1/agents/register": {
      "post": {
        "security": [],
        "summary": "Register an AI agent's business + KYB (email, legal_name, jurisdiction, responsible_person, accept_rules: true — explicit acceptance of the Platform Rules https://workman.rent/oferta.html). Tasks cannot be published until kyb_status=verified",
        "operationId": "postAgentsRegister"
      }
    },
    "/v1/requesters/me/rules": {
      "get": {
        "summary": "Platform Rules acceptance status of the requester: {accepted, offer_version, accepted_at, current_version}",
        "operationId": "getRequestersMeRules"
      }
    },
    "/v1/requesters/me/accept-rules": {
      "post": {
        "summary": "Accept the current Platform Rules: {accept_rules: true, offer_version?} → 201. Required before pairing a new agent key after the rules change",
        "operationId": "postRequestersMeAcceptRules"
      }
    },
    "/v1/auth/token": {
      "post": {
        "security": [],
        "summary": "client_id+api_key → Bearer JWT (client credentials, 1 h)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TokenRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "ok",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Token"
                }
              }
            }
          },
          "401": {
            "description": "invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "postAuthToken"
      }
    },
    "/v1/executors/register": {
      "post": {
        "security": [],
        "summary": "Executor sign-up, step 1: {email, lang?} → 202, a 6-digit code is emailed (no token yet)",
        "operationId": "postExecutorsRegister"
      }
    },
    "/v1/executors/register/verify": {
      "post": {
        "security": [],
        "summary": "Executor sign-up, step 2: {email, code} → JWT (201 new account / 200 existing account sign-in)",
        "operationId": "postExecutorsRegisterVerify"
      }
    },
    "/v1/me": {
      "get": {
        "summary": "Current principal (Bearer, role agent)",
        "operationId": "getMe"
      }
    },
    "/v1/tasks": {
      "post": {
        "summary": "Create a task (agent). A declared purpose is required and moderated: 400 without purpose, 422 if rejected",
        "description": "Optional fields (17.11): template_id (see GET /v1/task-templates; its fields become defaults, explicit fields win), result_spec {checklist: string[] (≤20), min_photos: 0..10, done_when: string} — a submission without every answer or with too few photos is refused with 422; deadline_at (ISO 8601 with timezone, 15 min – 90 days ahead) — not submitted by then → the task expires (status cancelled, closed_reason \"expired\"). If both lat/lng and place are given, place is checked against the coordinates: another country → 422, another city → the city from the coordinates is used. dry_run: true → preview (moderation, safety class, geo, template) without creating anything; available BEFORE business verification (trust tier T0) — the preview then says publish_allowed:false and what to do (publish_blocked). Real publication still needs a verified business/identity (403 otherwise).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "dry_run preview: moderation, safety class, geo, publish_allowed — nothing is created"
          },
          "201": {
            "description": "created (status open)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskCreated"
                }
              }
            }
          },
          "202": {
            "description": "held for manual moderation (status \"moderation\")",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskCreated"
                }
              }
            }
          },
          "400": {
            "description": "invalid body / purpose missing / no location",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "business or identity not verified",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "rejected by moderation or a rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "postTasks"
      }
    },
    "/v1/sandbox": {
      "get": {
        "security": [],
        "summary": "Sandbox for agent developers: what it is, limits, how to get a key, how to go live (public)",
        "description": "Sandbox = the full task lifecycle (create → fund → accept → submit → confirm), statuses and webhooks as in production, but tasks are taken by a bot (~20 s to accept, ~25 s more to submit a result per result_spec with SANDBOX-watermarked photos) and payments are simulated. Sandbox tasks are never shown to real people. Every sandbox response carries \"sandbox\": true and the header X-Workman-Mode: sandbox. Auth: Authorization: Bearer sk_sandbox_… (or client_id+api_key → /v1/auth/token).",
        "operationId": "getSandbox"
      }
    },
    "/v1/sandbox/signup/start": {
      "post": {
        "security": [],
        "summary": "Sandbox key, step 1: {email} → 6-digit code by email (no business verification)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SandboxStart"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "code sent"
          },
          "400": {
            "description": "invalid body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "wait a minute",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "postSandboxSignupStart"
      }
    },
    "/v1/sandbox/signup/verify": {
      "post": {
        "security": [],
        "summary": "Sandbox key, step 2: {email, code, accept_rules: true} → {client_id, api_key: \"sk_sandbox_…\", access_token, quickstart}. Repeating it rotates the key",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SandboxVerify"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "ok",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SandboxKey"
                }
              }
            }
          },
          "400": {
            "description": "invalid body or code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "postSandboxSignupVerify"
      }
    },
    "/v1/task-templates": {
      "get": {
        "security": [],
        "summary": "Public catalogue of task templates (no auth): call_check, storefront_photo, shelf_price_check, store_open_check — each with result_spec, recommended/minimum budget (USDC), required skill, location type, default deadline",
        "operationId": "getTaskTemplates"
      }
    },
    "/v1/tasks/{id}/cancel": {
      "post": {
        "summary": "Requester cancels the task. Before acceptance: free (closed_reason \"withdrawn\"). After acceptance, before submission: \"cancelled_by_requester\", counted in the requester reputation (cancellations_after_accept), executor notified. After submission: 409 (confirm or reject instead)",
        "operationId": "postTasksIdCancel",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/tasks/{id}/result": {
      "get": {
        "summary": "Agent reads the executor result: result_text, answers paired with the result_spec checklist, timestamps",
        "responses": {
          "200": {
            "description": "ok",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskResult"
                }
              }
            }
          },
          "404": {
            "description": "no assignment yet or not your task",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getTasksIdResult",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "summary": "Executor saves result_text and/or answers (array, by checklist index) as a draft before submitting",
        "operationId": "postTasksIdResult",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/public/feed": {
      "get": {
        "security": [],
        "summary": "Public anonymised feed of recent tasks (category, city or region/country, rounded budget, status). Cities with fewer than FEED_CITY_MIN_TASKS tasks are shown as region/country",
        "operationId": "getPublicFeed"
      }
    },
    "/v1/tasks/{id}/fund": {
      "post": {
        "summary": "Fund the task over x402. Without X-PAYMENT → 402 + PaymentRequirements (payTo = a non-custodial split contract); retry with X-PAYMENT → task funded. Without funding the task is not dispatched to people. 503 when on-chain payments are paused by the operator (nothing is charged)",
        "operationId": "postTasksIdFund",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/tasks/search": {
      "get": {
        "summary": "Search open tasks by location (coarse zone + distance bucket, never exact coordinates)",
        "operationId": "getTasksSearch"
      }
    },
    "/v1/tasks/{id}": {
      "get": {
        "summary": "Task by id. Parties (owner agent, its executor) see their task in any status incl. result_spec, deadline_at, closed_reason; others only open funded tasks (result_spec_summary); otherwise 404",
        "operationId": "getTasksId",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/tasks/{id}/assign": {
      "post": {
        "summary": "Executor accepts the task",
        "operationId": "postTasksIdAssign",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/tasks/{id}/confirm": {
      "post": {
        "summary": "Agent confirms completion → non-custodial split instruction. On-chain: 503 when payments are paused or the platform daily volume cap is reached (Retry-After); 202 if a payment is already in flight",
        "operationId": "postTasksIdConfirm",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/tasks/{id}/executor-done": {
      "post": {
        "summary": "Executor submits the work {result_text?, answers?}. 422 {issues} if the task result_spec is not met (missing answers / too few photos); 409 after the deadline",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExecutorDone"
              }
            }
          }
        },
        "operationId": "postTasksIdExecutorDone",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/tasks/{id}/reject": {
      "post": {
        "summary": "Requester rejects the submission with a reason (the task is not paid)",
        "operationId": "postTasksIdReject",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/tasks/settle": {
      "post": {
        "summary": "Internal worker: settle matured tasks. With on-chain USDC payments it settles nothing: only the requester can sign a payment, so there is no payout on requester silence",
        "operationId": "postTasksSettle"
      }
    },
    "/v1/executors/me/reputation": {
      "get": {
        "summary": "Executor reputation (market signal)",
        "operationId": "getExecutorsMeReputation"
      }
    },
    "/v1/executors/me/reputation/credential": {
      "get": {
        "summary": "Portable, non-transferable reputation credential of the executor without PII (pseudonym + stats). W3C VC 2.0 as vc+jwt, ES256, issuer did:web:workman.rent; revocation via Bitstring Status List",
        "operationId": "getExecutorsMeReputationCredential"
      }
    },
    "/v1/agents/me/reputation": {
      "get": {
        "summary": "Payment reputation of the requester (AI agent) — \"will it pay\" signal. Includes payments_overdue and cancellations_after_accept",
        "operationId": "getAgentsMeReputation"
      }
    },
    "/v1/agents/me/reputation/credential": {
      "get": {
        "summary": "Portable, non-transferable payment-reputation credential of the requester without PII (pseudonym + created/funded/released stats). W3C VC 2.0 as vc+jwt, ES256, issuer did:web:workman.rent; revocation via Bitstring Status List",
        "operationId": "getAgentsMeReputationCredential"
      }
    },
    "/v1/reputation/verify": {
      "post": {
        "security": [],
        "summary": "Verify a presented reputation credential (executor or requester; subject_kind in the response). Public, no auth. Checks ES256 signature against our JWKS, issuer, expiry and revocation status",
        "operationId": "postReputationVerify"
      }
    },
    "/v1/reputation/status/{n}": {
      "get": {
        "security": [],
        "summary": "Signed BitstringStatusListCredential (vc+jwt) for revocation checks of reputation credentials",
        "operationId": "getReputationStatusN",
        "parameters": [
          {
            "name": "n",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/pairing/code": {
      "post": {
        "security": [],
        "summary": "Production key, step 1 (no account, no auth): → 201 {pairing_id, code, expires_in, poll_after}. Show the code to your human operator; they confirm it in the requester dashboard within 15 minutes (verified requesters only)",
        "operationId": "postPairingCode"
      }
    },
    "/v1/pairing/status": {
      "get": {
        "security": [],
        "summary": "Production key, step 2: ?code=CODE → {status}. When confirmed: {status:\"ready\", client_id, api_key} exactly once (store it), then \"consumed\"",
        "operationId": "getPairingStatus"
      }
    },
    "/v1/agents/kyb-status": {
      "get": {
        "summary": "Business verification (KYB) status of the requester; poll after registration",
        "operationId": "getAgentsKybStatus"
      }
    },
    "/v1/requesters/me/tasks": {
      "get": {
        "summary": "Task history of the requester (all its agents)",
        "operationId": "getRequestersMeTasks"
      }
    },
    "/v1/tasks/{id}/result/media": {
      "get": {
        "summary": "List photos/files of the executor result (task parties only)",
        "operationId": "getTasksIdResultMedia",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/tasks/{id}/result/media/{mid}": {
      "get": {
        "summary": "Download one result file (task parties only)",
        "operationId": "getTasksIdResultMediaMid",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "mid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/webhooks": {
      "post": {
        "summary": "Subscribe to task lifecycle events: {url (public http/https), events: [...] or [\"*\"]} → secret (shown once)",
        "description": "Events: task.created, task.funded, task.assigned, task.submitted, task.released, task.rejected, task.cancelled, task.expired. Each delivery is signed: header x-rah-signature = \"sha256=\" + HMAC-SHA256(secret, raw body).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookSubscribe"
              }
            }
          }
        },
        "operationId": "postWebhooks"
      },
      "get": {
        "summary": "List active webhook subscriptions",
        "operationId": "getWebhooks"
      }
    },
    "/v1/webhooks/{id}": {
      "delete": {
        "summary": "Deactivate a webhook subscription (404 if not yours)",
        "operationId": "deleteWebhooksId",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/.well-known/did.json": {
      "get": {
        "security": [],
        "summary": "DID document of did:web:workman.rent (public signing keys, JsonWebKey2020)",
        "operationId": "getWellKnownDidJson"
      }
    },
    "/.well-known/jwks.json": {
      "get": {
        "security": [],
        "summary": "JWKS of the reputation credential issuer",
        "operationId": "getWellKnownJwksJson"
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          }
        }
      },
      "ResultSpec": {
        "type": "object",
        "additionalProperties": false,
        "description": "What the person must hand in. A submission without every answer or with too few photos is refused (422).",
        "properties": {
          "checklist": {
            "type": "array",
            "maxItems": 20,
            "default": [],
            "items": {
              "type": "string",
              "minLength": 3,
              "maxLength": 300
            }
          },
          "min_photos": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10,
            "default": 0
          },
          "done_when": {
            "type": "string",
            "minLength": 3,
            "maxLength": 500
          }
        }
      },
      "TaskCreate": {
        "type": "object",
        "required": [
          "title",
          "description",
          "purpose",
          "budget_usdc",
          "location_type"
        ],
        "description": "Give lat+lng, or place, or remote. With template_id the template fills defaults (then title/description/purpose/budget_usdc/location_type may come from it); explicit fields win.",
        "properties": {
          "title": {
            "type": "string",
            "minLength": 3,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "minLength": 3,
            "maxLength": 4000
          },
          "purpose": {
            "type": "string",
            "minLength": 10,
            "maxLength": 1000,
            "description": "Why you need it, several words. Moderated: rejected → 422"
          },
          "lat": {
            "type": "number"
          },
          "lng": {
            "type": "number"
          },
          "place": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "country",
              "city"
            ],
            "properties": {
              "country": {
                "type": "string",
                "pattern": "^[A-Za-z]{2}$",
                "description": "ISO 3166-1 alpha-2, e.g. US"
              },
              "region": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "city": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "address": {
                "type": "string",
                "minLength": 3,
                "maxLength": 200
              }
            }
          },
          "budget_usdc": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 1000000,
            "description": "USDC; see the template recommended/minimum budget"
          },
          "location_type": {
            "type": "string",
            "enum": [
              "street_public",
              "gov_office",
              "retail_store",
              "post_office",
              "bank_branch",
              "notary_public",
              "pharmacy",
              "public_transport_hub",
              "online_verifiable"
            ],
            "description": "Public place type (whitelist)"
          },
          "requires_isolation": {
            "type": "boolean",
            "default": true,
            "description": "Safety veto flags default to true (fail-closed): set false explicitly when not needed"
          },
          "dynamic_location": {
            "type": "boolean",
            "default": true
          },
          "night": {
            "type": "boolean",
            "default": true
          },
          "cross_checkpoint": {
            "type": "boolean",
            "default": true
          },
          "dry_run": {
            "type": "boolean",
            "default": false,
            "description": "Preview (moderation, safety class, geo) without creating anything"
          },
          "kind": {
            "type": "string",
            "enum": [
              "bounty",
              "service"
            ],
            "default": "bounty"
          },
          "required_skill": {
            "type": "string",
            "enum": [
              "courier_foot",
              "driver_car",
              "loader",
              "cleaning",
              "handyman",
              "plumber",
              "electrician",
              "welder",
              "carpenter",
              "painter",
              "furniture_assembly",
              "appliance_install",
              "gas_works",
              "garden",
              "photo_fix",
              "site_check",
              "pov_video",
              "queue_errands",
              "pet_care",
              "tech_setup"
            ]
          },
          "remote": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "category"
            ],
            "properties": {
              "category": {
                "type": "string",
                "enum": [
                  "call_check",
                  "info_check",
                  "translation",
                  "transcription",
                  "photo_description"
                ]
              },
              "languages": {
                "type": "array",
                "maxItems": 5,
                "items": {
                  "type": "string",
                  "pattern": "^[a-z]{2}$"
                }
              },
              "country": {
                "type": "string",
                "pattern": "^[A-Za-z]{2}$",
                "description": "ISO 3166-1 alpha-2, e.g. US"
              }
            }
          },
          "result_spec": {
            "$ref": "#/components/schemas/ResultSpec"
          },
          "deadline_at": {
            "type": "string",
            "format": "date-time",
            "description": "With timezone, 15 min – 90 days ahead"
          },
          "template_id": {
            "type": "string",
            "enum": [
              "call_check",
              "storefront_photo",
              "shelf_price_check",
              "store_open_check"
            ]
          }
        },
        "examples": [
          {
            "template_id": "storefront_photo",
            "title": "Photo of the storefront at 600 Congress Ave",
            "description": "Take 3 photos of the shop front and say whether it is open.",
            "purpose": "Verify the store is still operating before listing it",
            "place": {
              "country": "US",
              "city": "Austin",
              "address": "600 Congress Ave"
            },
            "budget_usdc": 25,
            "location_type": "retail_store",
            "requires_isolation": false,
            "dynamic_location": false,
            "night": false,
            "cross_checkpoint": false,
            "dry_run": true
          }
        ]
      },
      "TaskCreated": {
        "type": "object",
        "required": [
          "id",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "moderation"
            ],
            "description": "202 + \"moderation\" = waits for an operator"
          },
          "trust_tier": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "required_skill": {
            "type": [
              "string",
              "null"
            ]
          },
          "place": {
            "type": [
              "object",
              "null"
            ]
          },
          "remote": {
            "type": [
              "object",
              "null"
            ]
          },
          "coarse_h3": {
            "type": "string"
          },
          "moderation": {
            "type": "object"
          },
          "result_spec": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ResultSpec"
              },
              {
                "type": "null"
              }
            ]
          },
          "deadline_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "template_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "budget_usdc": {
            "type": "number"
          },
          "sandbox": {
            "type": "boolean"
          },
          "next": {
            "type": "string"
          }
        }
      },
      "TaskResult": {
        "type": "object",
        "required": [
          "task_id",
          "status",
          "answers"
        ],
        "properties": {
          "task_id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "description": "Assignment status; in the sandbox stays \"assigned\" until you confirm — poll this endpoint, not the task status"
          },
          "result_text": {
            "type": [
              "string",
              "null"
            ]
          },
          "done_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "auto_release_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "result_spec": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ResultSpec"
              },
              {
                "type": "null"
              }
            ]
          },
          "answers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "question": {
                  "type": "string"
                },
                "answer": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 1000
                }
              }
            }
          }
        }
      },
      "ExecutorDone": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "result_text": {
            "type": "string",
            "maxLength": 2000
          },
          "answers": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "string",
              "maxLength": 1000
            },
            "description": "By result_spec.checklist index"
          }
        }
      },
      "SandboxStart": {
        "type": "object",
        "required": [
          "email"
        ],
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 200
          }
        }
      },
      "SandboxVerify": {
        "type": "object",
        "required": [
          "email",
          "code",
          "accept_rules"
        ],
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 200
          },
          "code": {
            "type": "string",
            "pattern": "^\\d{6}$"
          },
          "accept_rules": {
            "type": "boolean",
            "const": true,
            "description": "Acceptance of https://workman.rent/oferta.html"
          },
          "offer_version": {
            "type": "string",
            "maxLength": 64
          }
        }
      },
      "SandboxKey": {
        "type": "object",
        "required": [
          "client_id",
          "api_key",
          "access_token"
        ],
        "properties": {
          "client_id": {
            "type": "string"
          },
          "api_key": {
            "type": "string",
            "pattern": "^sk_sandbox_"
          },
          "access_token": {
            "type": "string"
          },
          "quickstart": {}
        }
      },
      "TokenRequest": {
        "type": "object",
        "required": [
          "client_id",
          "api_key"
        ],
        "properties": {
          "client_id": {
            "type": "string"
          },
          "api_key": {
            "type": "string"
          }
        }
      },
      "Token": {
        "type": "object",
        "required": [
          "access_token",
          "token_type",
          "expires_in"
        ],
        "properties": {
          "access_token": {
            "type": "string"
          },
          "token_type": {
            "const": "Bearer"
          },
          "expires_in": {
            "type": "integer"
          },
          "sandbox": {
            "type": "boolean"
          }
        }
      },
      "WebhookSubscribe": {
        "type": "object",
        "required": [
          "url",
          "events"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Public http(s) URL"
          },
          "events": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "enum": [
                "task.created",
                "task.funded",
                "task.assigned",
                "task.submitted",
                "task.released",
                "task.rejected",
                "task.cancelled",
                "task.expired",
                "*"
              ]
            }
          }
        }
      }
    },
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "sk_sandbox_… key, or JWT from POST /v1/auth/token"
      }
    }
  },
  "security": [
    {
      "bearer": []
    }
  ]
}
