{"openapi":"3.1.0","info":{"title":"Código 07 API","version":"1.2.0","description":"Marketplace of human verifiers in Peru for AI agents. Same capabilities as the MCP server at /mcp. No auth. Paid endpoints use x402 (v2 headers PAYMENT-REQUIRED / PAYMENT-SIGNATURE / PAYMENT-RESPONSE; v1 X-PAYMENT also accepted), USDC on Base. Paying confirms the task instantly; no human approval. Optional webhook_url receives signed status updates (X-Codigo07-Signature = HMAC-SHA256 of the body with your token_consulta)."},"servers":[{"url":"https://codigo07.vercel.app"}],"paths":{"/api/servicios":{"get":{"operationId":"listar_servicios","summary":"Returns the catalog of human verification services in Peru: USD prices, turnaround, coverage, today's remaining capacity, x402 payment details (network, asset, payTo) and hard limits. Call this first.","responses":{"200":{"description":"Catalog"}}}},"/api/cotizar":{"get":{"operationId":"cotizar","summary":"Returns the exact price, turnaround and today's remaining capacity for a service, or tells you it needs a custom quote. Does not create anything or charge anything.","parameters":[{"name":"servicio","in":"query","required":true,"schema":{"type":"string","enum":["verificacion_remota","visita_presencial_lima","personalizado"],"description":"verificacion_remota = USD 25, 24 h (phone call in Spanish + SUNAT/RUC lookup + web check, anywhere in Peru). visita_presencial_lima = USD 75, 48 h (on-site visit in Metropolitan Lima/Callao, 6+ geotagged photos). personalizado = free quote request for anything else (e.g. visits outside Lima), paid later with pagar_solicitud."}},{"name":"urgente","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"ubicacion","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Quote"},"400":{"description":"Invalid servicio"}}}},"/api/solicitudes":{"post":{"operationId":"solicitar_verificacion","summary":"Books a vetted human verifier from the Código 07 network in Peru to check something in the physical world. The first available verifier accepts it and delivers a report with geotagged photos. Standard services are paid instantly and confirmed with no human approval. Payment: x402 v2 (v1 compatible), USDC on Base. Call once without payment to receive a PaymentRequired (isError=true, structuredContent). Retry the SAME call adding params._meta[\"x402/payment\"] with the signed PaymentPayload. When it settles, the task is confirmed instantly with no human approval, and the result includes _meta[\"x402/payment-response\"]. Returns id + token_consulta; store both. servicio \"personalizado\" (or an on-site visit outside Lima) creates a free quote request instead; pay it later with pagar_solicitud. Prohibited requests (surveillance of private individuals, entering private property, handling money/packages, impersonation, anything illegal) are rejected automatically before any charge.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"servicio":{"type":"string","enum":["verificacion_remota","visita_presencial_lima","personalizado"],"description":"verificacion_remota = USD 25, 24 h (phone call in Spanish + SUNAT/RUC lookup + web check, anywhere in Peru). visita_presencial_lima = USD 75, 48 h (on-site visit in Metropolitan Lima/Callao, 6+ geotagged photos). personalizado = free quote request for anything else (e.g. visits outside Lima), paid later with pagar_solicitud."},"que_verificar":{"type":"string","minLength":10,"maxLength":4000,"description":"What exactly must be verified, in Spanish or English. Be specific: the question to answer and why."},"ubicacion":{"type":"string","maxLength":500,"description":"Full address and district (for on-site visits) or city."},"ruc":{"type":"string","pattern":"^[0-9]{11}$","description":"Peruvian company tax ID (RUC, 11 digits), if relevant."},"entregable_esperado":{"type":"string","maxLength":1000,"description":"What you expect back (e.g. \"6 photos of storefront + yes/no on whether it is open\")."},"urgente":{"type":"boolean","default":false,"description":"Rush job (+50%, half the turnaround)."},"agente":{"type":"string","maxLength":200,"description":"Name/identifier of your agent."},"contacto_email":{"type":"string","format":"email","description":"Optional. Inbox where status updates can be sent."},"contacto_whatsapp":{"type":"string","maxLength":30,"description":"Optional WhatsApp number with country code."},"webhook_url":{"type":"string","format":"uri","description":"Optional https URL. Receives POST updates (cotizada, completada, cancelada) signed with X-Codigo07-Signature = sha256 HMAC of the raw body using your token_consulta."},"acepta_terminos":{"type":"boolean","const":true,"description":"Must be true: you accept the terms and limits at https://codigo07.vercel.app/#terminos."}},"required":["servicio","que_verificar","acepta_terminos"],"additionalProperties":false}}}},"responses":{"200":{"description":"Paid and confirmed. Returns id and token_consulta. PAYMENT-RESPONSE header carries the settlement."},"201":{"description":"Free quote request created (servicio personalizado)."},"402":{"description":"Payment required (x402). PAYMENT-REQUIRED header (v2, base64) and v1 body."},"409":{"description":"No capacity today"},"422":{"description":"Rejected by the automatic filter. Nothing charged."}}}},"/api/pagar":{"post":{"operationId":"pagar_solicitud","summary":"Pays a custom request once its status is \"cotizada\" and confirms it instantly. Payment: x402 v2 (v1 compatible), USDC on Base. Call once without payment to receive a PaymentRequired (isError=true, structuredContent). Retry the SAME call adding params._meta[\"x402/payment\"] with the signed PaymentPayload. When it settles, the task is confirmed instantly with no human approval, and the result includes _meta[\"x402/payment-response\"].","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Request id, e.g. C07-1A2B3C4D"},"token":{"type":"string","description":"token_consulta returned when the request was created"}},"required":["id","token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Paid and confirmed."},"402":{"description":"Payment required (x402)."}}}},"/api/estado":{"get":{"operationId":"consultar_estado","summary":"Returns status (cotizacion_pendiente, cotizada, pago_en_proceso, pagada, en_proceso, completada, pago_fallido, rechazada, cancelada), price, delivery deadline, payment transaction, and when completed: the report (conclusion, details, geotagged photo URLs) plus a human-readable report URL.","parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string"}},{"name":"token","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Status, report and evidence when completed"},"400":{"description":"Not found or invalid token"}}}},"/api/calificar":{"post":{"operationId":"calificar_servicio","summary":"Rates the verifier who completed a task (1 to 5 stars, optional comment). Ratings rank verifiers in the network. One rating per task.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Request id"},"token":{"type":"string","description":"token_consulta"},"estrellas":{"type":"integer","minimum":1,"maximum":5},"comentario":{"type":"string","maxLength":1000}},"required":["id","token","estrellas"],"additionalProperties":false}}}},"responses":{"200":{"description":"Rating saved"}}}}}}