{"openapi":"3.0.3","info":{"title":"Verety API","version":"1.0.0-pre","description":"Entity verification across business registries. Authenticate every request with your API key in the `x-api-key` header (or `Authorization: Bearer`). Create keys in the app under Account → API keys. API access comes with the Growth and Pro plans or any credit pack. Each investigation uses one check: the plan's checks for the period first, then credit-pack credits, shared with the app; the rate limit is set per plan. A refused check or gated feature returns the CreditError body (402 or 403). The same key works on the MCP endpoint (POST /api/mcp)."},"security":[{"apiKey":[]}],"paths":{"/api/v1/search":{"get":{"summary":"Find a company — by registration number (exact), name+country (deterministic), or free text (agent-routed)","parameters":[{"name":"registrationNumber","in":"query","required":false,"schema":{"type":"string"},"description":"Official registration number (e.g. CNPJ). With `country`. Exact lookup: 0 or 1 results, no LLM."},{"name":"name","in":"query","required":false,"schema":{"type":"string"},"description":"Company name. With `country`. Deterministic registry search, no LLM; legal-form suffixes are stripped."},{"name":"country","in":"query","required":false,"schema":{"type":"string"},"description":"ISO 3166-1 alpha-2. Required with registrationNumber or name."},{"name":"q","in":"query","required":false,"schema":{"type":"string"},"description":"Free-text query (\"Grupo Bimbo Mexico\") — the Search Agent routes it. May name several companies, a region and details (director, city, year, \"active\"). Not combinable with the structured params."},{"name":"context","in":"query","required":false,"schema":{"type":"string"},"description":"With `q`: the JSON object {\"target\": …} from the previous response, so `q` refines that search (\"in France\")."}],"responses":{"200":{"description":"Interpretation (+ matchedBy/routedBy; for q also action, names, countries, filters) + `target` to send back as context + result cards (matches / mismatches against the details given) + how many registries answered"},"400":{"description":"Missing or conflicting parameters"},"401":{"description":"Missing or unknown API key"},"403":{"description":"Country outside the key's entitlements"},"422":{"description":"Registration-number lookup not available for this country"},"429":{"description":"Rate limit exceeded"}}}},"/api/v1/entity/{id}":{"get":{"summary":"Full registry record for one entity, by search-result id","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Entity id from a search result"}],"responses":{"200":{"description":"{ id, country, detail }. detail.identifiers lists the ids the registry itself publishes ({ label, value, trust, note }); Brazilian records also carry detail.entity.naturezaJuridicaLabel."},"403":{"description":"Key not entitled to this entity's country"},"404":{"description":"Unknown id or record not found"}}}},"/api/v1/entity/{id}/files":{"get":{"summary":"Documents on file for this entity: uploaded and collected during checks. What each is and whether it has been read; the facts are on /files/{fileId}","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Entity id from a search result"}],"responses":{"200":{"description":"{ entityId, files[] } — each { id, name, size, contentType, source: uploaded|collected|api, uploadedAt, status: pending|ready|failed, documentType, summary, link?, sourceUrl? }"},"403":{"description":"Key not entitled to this entity's country"},"404":{"description":"Unknown id"}}},"post":{"summary":"Upload a document for this entity. Read ONCE by the LLM in the background; every later investigate() uses the stored digest","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"query","required":true,"schema":{"type":"string"},"description":"Filename, e.g. \"acra-profile.pdf\""}],"requestBody":{"description":"Raw file bytes; Content-Type is the file's type. PDF (text or scanned), PNG/JPEG/WebP, TXT/CSV, DOCX, XLSX. 8 MB max.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"The same content is already on file: that file, with duplicate: true. Nothing stored or read again"},"202":{"description":"The new file, status \"pending\"; get /files/{fileId} until \"ready\" (a few seconds to a minute) or \"failed\""},"400":{"description":"Missing name or empty body"},"413":{"description":"File larger than 8 MB"},"415":{"description":"Unsupported file type"},"503":{"description":"File storage not configured"}}}},"/api/v1/entity/{id}/files/{fileId}":{"get":{"summary":"One document with what the reader found","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"fileId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The list fields plus { docType, result: PASS|REVIEW|FAIL, keyFacts: [{ field, label, value, quote, page, check: match|differs|none|edited, note, correctedFrom? }], otherFacts: [{ label, value }], dates, error? }. Never the text"},"404":{"description":"Unknown entity id, or no such file"}}}},"/api/v1/entities":{"get":{"summary":"The companies this account has checked, newest check first. Not the registry: one company's registry record is /api/v1/entity/{id}","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string"},"description":"Search by company name"},{"name":"view","in":"query","required":false,"schema":{"type":"string","enum":["active","archived"]},"description":"Defaults to active"},{"name":"sort","in":"query","required":false,"schema":{"type":"string","enum":["checked","name","risk","signals","tasks"]},"description":"Defaults to checked"},{"name":"order","in":"query","required":false,"schema":{"type":"string","enum":["asc","desc"]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200},"description":"Defaults to 50"},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"nextCursor from the previous page"}],"responses":{"200":{"description":"{ items[], nextCursor, counts: { view: { active, archived } } } — each item { id, name, country, riskScore, verdict: ok|review|fail (the account's current view, false positives taken out), lastCheckedAt, lastSource, checks, openTasks, newSignals, archived }"},"400":{"description":"invalid_parameters ({ error, detail })"},"401":{"description":"Missing, unknown or revoked API key"}}}},"/api/v1/entity/{id}/checks":{"get":{"summary":"The checks this account kept for one company, newest first. Open one with /api/v1/checks/{checkId}","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Entity id"},{"name":"source","in":"query","required":false,"schema":{"type":"string"},"description":"Comma-separated: search, monitor, api, mcp, agent, chat, shared"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200},"description":"Defaults to 50"},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"{ entityId, items[], nextCursor, counts: { source } } — each item { checkId, source, createdAt, riskScore, verdict, goals }"},"400":{"description":"invalid_parameters ({ error, detail })"},"404":{"description":"This account never checked this company"}}}},"/api/v1/checks/{id}":{"get":{"summary":"One kept check: the same result investigate returned","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"checkId from investigate or /api/v1/entity/{id}/checks"}],"responses":{"200":{"description":"{ checkId, saved, source, createdAt, entity, goals, decision: approve|review|decline (what this check concluded), riskScore, complianceScore (the score the app shows: on the company's latest check, with the officer's false positives and confirmed checks), adjustedByOfficer, runScore: { riskScore, complianceScore } (when adjusted: the run's own score), scoreBreakdown: { risk: { value, sum, cap, raisedByMinimum }, compliance: { value, lost, heldByMinimum }, minimum: { kind, risk, compliance } | null, findings[] ({ findingId, title, severity: fail|review, risk, compliance, status: counted|fp|accepted }) } | null, confidence, headline, summary, findings[], notChecked[], nextSteps[], url }"},"404":{"description":"No such check in this account"}}}},"/api/v1/tasks":{"get":{"summary":"The account's follow-up tasks, like the Tasks page: across companies, for some, or general tasks with no company","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["open","done","dismissed","all"]},"description":"Defaults to open"},{"name":"entity","in":"query","required":false,"schema":{"type":"string"},"description":"Comma-separated entity ids, or \"general\""},{"name":"by","in":"query","required":false,"schema":{"type":"string"},"description":"Comma-separated: investigator, user, chat, signal"},{"name":"q","in":"query","required":false,"schema":{"type":"string"},"description":"Search title and note"},{"name":"sort","in":"query","required":false,"schema":{"type":"string","enum":["updated","title","entity","by","files"]},"description":"Defaults to updated"},{"name":"order","in":"query","required":false,"schema":{"type":"string","enum":["asc","desc"]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200},"description":"Defaults to 50"},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"{ items[], nextCursor, counts } — each item { id, title, note, status, source, finding?, run, createdAt, updatedAt, entity: { id, name } | null, files }"},"400":{"description":"invalid_parameters ({ error, detail })"}}},"post":{"summary":"Add a task, for one company or as a general task. Its history shows it was added through the API","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["title"],"properties":{"title":{"type":"string","maxLength":200},"note":{"type":"string","maxLength":500},"entityId":{"type":"string","description":"Leave out for a general task"}}}}}},"responses":{"201":{"description":"The new task, in the list item shape"},"400":{"description":"missing_title, or invalid_parameters ({ error, detail })"},"404":{"description":"unknown_id: not a company id"}}}},"/api/v1/tasks/{id}":{"patch":{"summary":"Mark a task done or open again, or change its title or note. Tasks are never deleted through the API","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["open","done"]},"title":{"type":"string","maxLength":200},"note":{"type":"string","maxLength":500}}}}}},"responses":{"200":{"description":"The task, in the list item shape"},"400":{"description":"invalid_parameters ({ error, detail })"},"404":{"description":"No such task in this account"}}}},"/api/v1/onboarding":{"post":{"summary":"Start an onboarding check of a person or a business. The tier (1 identity data, 2 full KYC/KYB, 3 enhanced) comes from your onboarding policy by service and amount. Returns the case at once; follow it with GET or the webhooks. Uses one check","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["subjectType","serviceType","lawfulBasis"],"properties":{"subjectType":{"type":"string","enum":["person","company"]},"serviceType":{"type":"string","enum":["non_financial","financial","virtual_currency","loan"],"description":"With amount, decides the tier"},"amount":{"type":"number","description":"Six-month volume, or the loan. At or above the policy threshold: tier 3"},"currency":{"type":"string","description":"ISO 4217; the policy currency (ILS by default) when left out"},"tier":{"type":"integer","minimum":1,"maximum":3,"description":"A deeper tier than the policy gives, never a lighter one"},"person":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"birthDate":{"type":"string","description":"YYYY-MM-DD (or YYYY-MM, YYYY)"},"nationalId":{"type":"string","description":"National ID number: format and check digit validated; stored encrypted, shown masked"},"idCountry":{"type":"string","description":"ISO 3166-1 alpha-2 of the country that issued nationalId"},"nationality":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string","description":"International format, e.g. +972525551234"}}},"company":{"type":"object","description":"entityId from search, or country + registrationNumber","properties":{"entityId":{"type":"string"},"country":{"type":"string"},"registrationNumber":{"type":"string"}}},"returnUrl":{"type":"string","description":"https address the ID verification page sends the person to when done"},"clientRef":{"type":"string","maxLength":200,"description":"Your own reference, unique per account"},"purpose":{"type":"string","maxLength":500},"lawfulBasis":{"type":"boolean","description":"Must be true: you have a lawful basis to check this subject"}}}}}},"responses":{"201":{"description":"The case (OnboardingCase), status running. From the ID verification tier, identityVerification.verificationUrl is the link to send the person","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingCase"}}}},"400":{"description":"{ error, message }: lawful_basis_required, invalid_subject_type, invalid_service_type, missing_name, invalid_birth_date, missing_company, invalid_amount, invalid_return_url"},"402":{"description":"insufficient_credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditError"}}}},"403":{"description":"API_ACCESS_REQUIRED or EMAIL_UNVERIFIED (CreditError), or country_not_entitled"},"404":{"description":"unknown_id: the company was not found"},"409":{"description":"duplicate_client_ref (the check is given back)"},"503":{"description":"not_started: the check or the ID verification could not be started; not charged"}}},"get":{"summary":"The account's onboarding cases, newest first","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["running","awaiting_subject","in_review","decided","failed"]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200},"description":"Defaults to 50"}],"responses":{"200":{"description":"{ cases: OnboardingCase[] }"}}}},"/api/v1/onboarding/{caseId}":{"get":{"summary":"One onboarding case: status, decision, risk, findings, identity verification and decision history. No check used","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The case","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingCase"}}}},"404":{"description":"not_found"}}}},"/api/v1/onboarding/{caseId}/decision":{"post":{"summary":"A reviewer's decision on a case, or a change of a decided one. A rejection and every change need a reason; each decision is kept in history","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["decision"],"properties":{"decision":{"type":"string","enum":["approved","rejected"]},"reason":{"type":"string","maxLength":1000}}}}}},"responses":{"200":{"description":"The case, decided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingCase"}}}},"400":{"description":"invalid_decision, reason_required"},"404":{"description":"not_found"},"409":{"description":"not_reviewable (still running, or failed), same_decision"}}}},"/api/v1/entity":{"get":{"summary":"Full registry record by official registration number","parameters":[{"name":"country","in":"query","required":true,"schema":{"type":"string"}},{"name":"registrationNumber","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"{ id, country, detail } — same detail shape as /api/v1/entity/{id}"},"404":{"description":"No record for this number"},"422":{"description":"Lookup not available for this country"}}}},"/api/v1/investigate":{"post":{"summary":"Full investigation of one entity by the investigator the app uses → a decision and structured findings with scores","requestBody":{"content":{"application/json":{"schema":{"type":"object","description":"Address the entity one of three ways: {entityId} · {country, registrationNumber} · {registry, registryRef}. Optional: goals[], maxCacheAgeDays, forceRefresh.","properties":{"entityId":{"type":"string","description":"Entity id from a search result"},"country":{"type":"string","description":"ISO code — with registrationNumber"},"registrationNumber":{"type":"string","description":"Official number (e.g. CNPJ) — with country"},"registry":{"type":"string","description":"Registry name from a search result — with registryRef"},"registryRef":{"type":"string","description":"Record key in that registry"},"goals":{"type":"array","items":{"type":"string","enum":["compliance","risk","partnership","employer","contractor"]},"description":"Why you are checking this entity. Defaults to [\"compliance\"]. Same goals as the app."},"maxCacheAgeDays":{"type":"number","description":"Max age (days) of a cached registry lookup; 0 fetches fresh"},"forceRefresh":{"type":"boolean","description":"Shorthand for maxCacheAgeDays: 0"}}}}}},"responses":{"200":{"description":"{ checkId, saved, source, createdAt, entity: { id, name, country }, goals, decision: approve|review|decline, riskScore, complianceScore, adjustedByOfficer: false, scoreBreakdown: { risk: { value, sum, cap, raisedByMinimum }, compliance: { value, lost, heldByMinimum }, minimum: { kind, risk, compliance } | null, findings[] ({ findingId, title, severity: fail|review, risk, compliance, status: counted|fp|accepted }) } | null, confidence, headline, summary, findings[] ({ id, section, risk, compliance, finding, sources }), notChecked[] ({ capability, reason }), nextSteps[], url, resolvedBy }. checkId and url are null unless the account keeps API and MCP checks"},"400":{"description":"Missing entity address"},"401":{"description":"Missing, unknown or revoked API key"},"402":{"description":"insufficient_credits — no checks left (code QUOTA_EXCEEDED), or a failed payment past its grace period (PAST_DUE)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditError"}}}},"403":{"description":"API_ACCESS_REQUIRED (Growth and above, or a credit pack), EMAIL_UNVERIFIED, or a country outside the key's entitlements"},"404":{"description":"Entity not found"},"422":{"description":"Unsupported lookup for this country/registry"},"429":{"description":"Rate limit exceeded"},"502":{"description":"investigation_failed ({ error, message }) — the investigator stopped with an error"}}}}},"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"x-api-key"}},"schemas":{"OnboardingCase":{"type":"object","properties":{"caseId":{"type":"string","example":"onb_5f0c…"},"status":{"type":"string","enum":["running","awaiting_subject","in_review","decided","failed"],"description":"awaiting_subject: the checks are done, the person has not finished ID verification"},"decision":{"type":"string","nullable":true,"enum":["approved","review","rejected"],"description":"Never rejected automatically"},"riskRating":{"type":"string","nullable":true,"enum":["low","medium","high"]},"tier":{"type":"integer","enum":[1,2,3]},"tierReason":{"type":"string"},"subject":{"type":"object","description":"{ type, name, country, entityId, person? } — person with nationalIdMasked, never the number"},"identityVerification":{"type":"object","nullable":true,"description":"{ provider, status (pending, approved, in_review, declined, abandoned, expired), verificationUrl (while pending), expiresAt, completedAt, document { type, country, name, expiry, numbersMasked }, liveness { status, score }, faceMatch { status, score }, warnings[] }"},"serviceType":{"type":"string"},"amount":{"type":"number","nullable":true},"currency":{"type":"string","nullable":true},"clientRef":{"type":"string","nullable":true},"purpose":{"type":"string","nullable":true},"findings":{"type":"array","items":{"type":"object"},"description":"The notable checks: { title, agent, risk, compliance, unverified, finding }"},"decisionReason":{"type":"string","nullable":true},"decidedBy":{"type":"string","nullable":true,"enum":["policy","reviewer"]},"reviewer":{"type":"string","nullable":true},"decidedAt":{"type":"string","nullable":true},"history":{"type":"array","items":{"type":"object"},"description":"Every decision, oldest first: { at, status, decision, risk, reason, by, from? }"},"checkId":{"type":"string","nullable":true,"description":"The kept check behind the case"},"checkUrl":{"type":"string","nullable":true},"runId":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}},"CreditError":{"type":"object","properties":{"error":{"type":"string","example":"insufficient_credits"},"code":{"type":"string","enum":["QUOTA_EXCEEDED","PAST_DUE","API_ACCESS_REQUIRED","EMAIL_UNVERIFIED"]},"message":{"type":"string"},"upgrade_url":{"type":"string","description":"Plans, on the billing page"},"topup_url":{"type":"string","description":"Credit packs, on the billing page"}}}}}}